Skip to content
Advertisement

Tag: c#

How do I get a space in my property name?

I have the following query: The problem is that I make the property ProjeAdı in the Select clause. I want the property to match the sql column, Proje Adı (note the space). How can I do that? Answer aliases cant have spaces between them , just like any variable name cant have white space, they are considered as bad naming

SqlCommand only returns one row

Trying to only return the first few number of rows because my database was too big, however when I was testing my SQL, I did a select * and was only returned the first row. What is wrong with my solution? Answer In your loop you constantly re-create the instance of the variable logs thus overwriting the previous one and

Can’t delete a row using entity framework

The problem that I’m having is that I can’t delete a row when using entity. I’m able to find the row, but the error I get the next error: Additional information: Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. See http://go.microsoft.com/fwlink/?LinkId=472540 for information on

how to get the ID of the record that is update in C#

I am able to get a sql query that can return the ID of a record that is update in the Database; that ID is needed to update other records. but I don’t know how to get that updated ID value in C#. Answer I think you’re really asking how do you retrieve the resultset returned by an INSERT or

Dumping SQL table to .csv C#

I am trying to implement a script in my application that will dump the entire contents (for now, but I am trying to write the code so that I can easily customize it to only grab certain columns) of a sql db (running ms sql server express 2014) to a .csv file. Here is the code I have written currently:

Advertisement