for a textbox i am sure that u wil not fetch more than one row of data
so,,..
[CODE=cpp]connection = new SqlConnection() ;
connection.Conn ectionString = "Persist Security Info=False;" +
"Integrated Security=SSPI;d atabase=northwi nd;" +
"server=localho st;Connect Timeout=30";
connection.Open ();
dataadapter = new SqlDataAdapter( "select * from customers", connection);
dataset = new DataSet();
dataadapter.Fil l(dataset, "table1");
//dataGrid1.DataS ource = dataset;
//so once ur dataset is filled then from that pick one value
textbox1.text = dataset.tables( "table1").colum ns("colname");[/CODE]
Originally posted by muskan
I want to put data into textboxes not datagrid
Last edited by Shashi Sadasivan; Nov 26 '07, 10:05 PM.
Reason: adding code tags
I tried the code above and it tells me that it can't connect to the server.
"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections."
Comment