VB :
Dim strConnectionString As String = "connetion string here"
Dim cnn As New SqlConnection(strConnectionString)
Dim cmd As SqlClient.SqlCommand = New SqlClient.SqlCommand("SELECT * FROM table ", cnn)
cmd.CommandType = CommandType.Text
Dim dacmd As New SqlClient.SqlDataAdapter(cmd)
Dim dscmd As New DataSet
dacmd.Fill(dscmd)
Datagrid1.DataSource = dsContract.Tables(0)
Datagrid1.DataBind()
C#:
{
string strConnectionString = "connetion string here";
SqlConnection cnn = new SqlConnection(strConnectionString);
SqlClient.SqlCommand cmd = new SqlClient.SqlCommand("SELECT * FROM table ", cnn);
cmd.CommandType = CommandType.Text;
SqlClient.SqlDataAdapter dacmd = new SqlClient.SqlDataAdapter(cmd);
DataSet dscmd = new DataSet();
dacmd.Fill(dscmd);
Datagrid1.DataSource = dsContract.Tables(0);
Datagrid1.DataBind();
}
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (2)
Commented:
Thanks
Tapan Pattanaik.
Author
Commented: