Databinding in c#

create name space as ,
using System.Data;
using System.Data.OleDb

then

String StrSql = "your sql query";
OleDbDataAdapter objDataAdapter = new OleDbDataAdapter(StrSql, sqlconnectionname);
DataSet objDataSet = new DataSet("ClientName");
objDataAdapter.Fill(objDataSet, "ClientName");
objDataAdapter.Dispose();




instead of OleDb we can use sqlclient accordingly

No comments:

Post a Comment