How can i connect my ASP.NET web application with my sql server 2000. i used visual studio 2003, and there we drag and drop the data adapter and then a sql connection and then use them in our application. but here we have only sqldatasource or something. so please tell me to make the connection and data retrieval procedure.
You can drag a SQL Data Source object onto you web form and select configure data source. This will give you a wizard to connect to a database, and also allows you to set up insert, delete, update statements. You can then use this datasource to delete/update/select/insert data.
Alternatively you can do it all manually in code, by creating sqlconnections, sqlcommands, sqldataadapters and readers with datasets.
SqlConnection oCon = new SqlConnection("your connection string"); string sQuery = "your SQL select statement"; SqlCommand oCmd = new SqlCommand(sQuery, oCon); DataSet oDs = new DataSet(); SqlDataAdapter oDa = new SqlDataAdapter(oCmd); oDa.Fill(oDs); DataList1.DataSource = oDs; DataList1.DataBind();
Here are some articles on the sql data source object
thanks for the help sir. i got it now