I looked at the site and on Google, but I could not find a suitable solution for what I was trying to do.
Basically, I have a client server application (C #) where I send the server SQL select statements (Connect to SQL Server 2008) and would like to return the results in a CSV image to the client.
So far I have the following:
if (sqlDataReader.HasRows) { while(sqlDataReader.Read()) { //not really sure what to put here and if the while should be there! }
} `
Unfortunately, I'm really new to connecting C # to SQL. I need tips on how to simply put the results in a string in csv format. Columns and fields can be different, so I can not use the method of something [something], as I saw on several sites. I'm not sure how clear tbh is!
I would really appreciate some tips / advice on how to do this, please!
c # sql sql-server client-server resultset
Errika
source share