473,320 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

bind database to datagrid

how to bind database to datagrig 2003
Oct 16 '07 #1
3 960
debasisdas
8,127 Expert 4TB
Question moved to .NET Forum.
Oct 16 '07 #2
Hi,
First u should declare an instance for SqlDataAdapter,Dataset.
Eg: Its C#.net code

Sqldataadapter sda;
Dataset ds=new DataSet();
...
...//establish ur connection.

sda=new sqldataadapter("Query",connection);
sda.fill(ds);
Datagrid.datasource=ds;
Datagrid.datamember=Convert.toString(ds.Tables[0]);
Datagrid.Databind();

The above is coding section.
U can also specify the datamember and datasource in property itself.
I think this may help u. Try out.

Cheers
Jeen
Oct 16 '07 #3
kenobewan
4,871 Expert 4TB
Please read the FAQs on how to post. Thanks.
Oct 16 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: kakss | last post by:
Hi I have a Winforms Datagrid and created myDataView and bind to datagrid. It works great. DataGrid1.SetDataBinding(myDataView, "") Above code line shows me below data in datagrid. ...
6
by: Ricardo Luceac | last post by:
Hi... My program make a select to an table and return the results to a datagrid, it's all ok with dataset, but in large tables it needs to get the entire table to show in datagrid and sometimes...
1
by: Jim Hammond | last post by:
The code below implements two datagrid columns that display images. The first column is just a test that always displays the same image directly from a file. The second column pulls the image from...
4
by: Greg Linwood | last post by:
I am wondering what the best approach to binding XML data to an asp:Table from the Page_Load event in a code behind module? I'm using VB.Net and initially approached this by adding a table to the...
3
by: AFN | last post by:
I need to manually create the data to be shown in a datagrid (or some data table object). Should I create an array and bind the array to the datagrid OR should I create a temporary dataset and...
1
by: Fred Flintstone | last post by:
Just new to .net, and started using oledb connection to database. After getting most things working, now want to bind to a datagrid, but have not been successful as of yet. Will use alternate db...
17
by: A_PK | last post by:
I have problem databinding the DataGrid with DataView/DataSet after the filter... I create the following proceudre in order for user to filter as many as they want, but the following code is only...
2
by: Santosh | last post by:
Dear all i want to bind data to datagrid header template i am wrtting follwing code it is displaying data with in item template not but it is display data in header template <asp:DataGrid...
1
by: Cylix | last post by:
I am going to show database table to a datagrid. I try to select the table to a sqlDataReader, but I found it is not straight to show it to the datagrid. It needs to convert the sqldatareader to a...
0
by: pbd22 | last post by:
Hi. I am returning to an old bit of code in our program and need to figure out how to sort my columns on bind. I am sorting on Date (mostly) and some other values. Problem is, the code is an...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.