We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Binding to a Dataset

hi,
How to bind the grid using a dataset.

plzz reply.

thanks.


3 Replies

JA Janagan Syncfusion Team May 14, 2008 01:44 PM UTC

Hi Santosh,

You can bind the dataset to the grid by the following code:



protected void Page_Load(object sender, EventArgs e)
{
this.oleDbConnection1.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=" + Server.MapPath(@"nwind.mdb") + @";Mode=Share Deny None;Extended Properties="""";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="""";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False";

{
Session["Ds"] = "DS1";
this.GridGroupingControl1.DataSource = this.DSWhenSupplierIS4;



this.oleDbDataAdapter1.Fill(this.DSWhenSupplierIS4);
this.DataBind();
}
}




Please refer the sample in the link below which illustrates the above:

http://websamples.syncfusion.com/samples/Grid.Web/6.2.0.40/Grid_ASP_Dataset/main.htm


Please try running the sample and let me know if this helps.

Thanks,
Janagan.




SA santosh May 15, 2008 12:37 PM UTC

Hi ,
thanks for the reply..what i did is I have added the aspx page to a new website and added the bin folder files to that.
but it is giving some error saying that
"Unknown element asp: Script manager"
what is the reason..plzz help me.

>Hi Santosh,

You can bind the dataset to the grid by the following code:



protected void Page_Load(object sender, EventArgs e)
{
this.oleDbConnection1.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=" + Server.MapPath(@"nwind.mdb") + @";Mode=Share Deny None;Extended Properties="""";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="""";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False";

{
Session["Ds"] = "DS1";
this.GridGroupingControl1.DataSource = this.DSWhenSupplierIS4;



this.oleDbDataAdapter1.Fill(this.DSWhenSupplierIS4);
this.DataBind();
}
}




Please refer the sample in the link below which illustrates the above:

http://websamples.syncfusion.com/samples/Grid.Web/6.2.0.40/Grid_ASP_Dataset/main.htm


Please try running the sample and let me know if this helps.

Thanks,
Janagan.






JA Janagan Syncfusion Team May 16, 2008 09:21 AM UTC

Hi Santosh,

Thanks for the update.

The error caused is due to the absence of script resources in the web.config file.

Please refer the Web.config file in the link below:

http://www.syncfusion.com/support/user/uploads/Grid_ASP_web_d96565b.zip

Please try running the sample with the above web.config file and let me know if this helps.

Thanks,
Janagan.




Loader.
Live Chat Icon For mobile
Up arrow icon