I have a question: is it possible to select data from a table in string (without using ToString method) rows?
Without using SqlDataReader
and with good performance.
For example read all table and put data to List of string type.1 element=1row
SqlConnection conn = new SqlConnection("Data Source=;Initial Catalog=;Persist Security Info=True;User ID=;Password=");
conn.Open();
SqlCommand command = new SqlCommand("Select id from [table1] where name=@zip", conn);
command.Parameters.AddWithValue("@zip","india");
// don't use reader
using (SqlDataReader reader = command.ExecuteReader())
{
if (reader.Read())
{
//List<string> = String.Format(row properties...)
}
}
Sorry for bad explanation