You have two options, DataReader or DataSet. Here is a dataset
implementation in C#.
string connString = "YourConnStringHere";
string sql = "SELECT * FROM SomeTable";
SqlConnection conn = new SqlConnection(connString);
SqlCommand cmd = new SqlCommand(sql, conn);
SqlAdapter adapt = new SqlAdapter(cmd);
DataSet ds = new DataSet();
//optionally using statement here
try
{
conn.Open();
adapt.Fill(ds);
}
finally
{
if(conn.State=ConnectionState.Open)
conn.Close();
conn.Dispose();
}
DataGrid1.DataSource=ds;
DataGrid1.DataBind();
Very simple pattern. Easily adaptable.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
*************************************************
Think outside the box!
*************************************************
"A P" <ap@textguru.ph> wrote in message
news:et**************@tk2msftngp13.phx.gbl...
I am new to VS.Net Professional but I am previously using Visual Interdev
6.0 . I want to list records from the database thru VS.Net . Its easy on
Visual Interdev but in VS .Net, I dont know how. Please help me!!!
Me