How to make a databind from a DataSet With Data Tables and TablesAdaptersWPWalter Pineda18yAsked Apr 16, 2008, 11:46 AM EDT1 answerShareLinkedInXCopy linkSave1 AnswerKnow the answer? Post it. Somebody with the same question will find it here.Niradhip ChakrabortyRank #428 · 5.8K points18y agoPosted Apr 16, 2008, 12:31 PM EDT0Here I am trying to bind ta data from shippers table to datagrid(DataGrid1) .NET Classes used : using System.Data.SqlClient;using System.Collections; Code: public void BindGrid() { try { sqlConn = new SqlConnection(ConfigurationSettings.AppSettings("ConnectionString")); string strSQL = "SELECT ShipperID, CompanyName FROM Shippers ORDER BY CompanyName"; SqlDataAdapter da = new SqlDataAdapter(strSQL, sqlConn); DataSet ds = new DataSet(); da.Fill(ds); DataGrid1.DataSource = ds; DataGrid1.DataBind(); } catch (SqlException ex) { Response.Write(ex.ToString()); } } 0Join to answer this questionEvery answer you publish earns 20 SHARP.Create free accountSign in
How to make a databind from a DataSet With Data Tables and TablesAdaptersWPWalter Pineda18yAsked Apr 16, 2008, 11:46 AM EDT1 answerShareLinkedInXCopy linkSave
Niradhip ChakrabortyRank #428 · 5.8K points18y agoPosted Apr 16, 2008, 12:31 PM EDT0Here I am trying to bind ta data from shippers table to datagrid(DataGrid1) .NET Classes used : using System.Data.SqlClient;using System.Collections; Code: public void BindGrid() { try { sqlConn = new SqlConnection(ConfigurationSettings.AppSettings("ConnectionString")); string strSQL = "SELECT ShipperID, CompanyName FROM Shippers ORDER BY CompanyName"; SqlDataAdapter da = new SqlDataAdapter(strSQL, sqlConn); DataSet ds = new DataSet(); da.Fill(ds); DataGrid1.DataSource = ds; DataGrid1.DataBind(); } catch (SqlException ex) { Response.Write(ex.ToString()); } } 0
Niradhip ChakrabortyRank #428 · 5.8K pointsPosted Apr 16, 2008, 12:31 PM EDT
Here I am trying to bind ta data from shippers table to datagrid(DataGrid1)
.NET Classes used :
using System.Data.SqlClient;
using System.Collections;
Code:
public void BindGrid()
{
try {
sqlConn = new SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"));
string strSQL = "SELECT ShipperID, CompanyName FROM Shippers ORDER BY CompanyName";
SqlDataAdapter da = new SqlDataAdapter(strSQL, sqlConn);
DataSet ds = new DataSet();
da.Fill(ds);
DataGrid1.DataSource = ds;
DataGrid1.DataBind();
}
catch (SqlException ex) {
Response.Write(ex.ToString());
}
}