Click here to Skip to main content
16,004,782 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to bind a datatable with database can i do it?
if yes and you have any code then help me to bind it
Posted

1 solution

Considering a DataTable holds the results of a query and you can't bind it to a database, you're question doesn't make any sense.

Are you referring to a ASP.NET GridView?? If so, there's tons of examples all over the web. All you need to do is type "ASP.NET GridView tutorial" into Google.
 
Share this answer
 
Comments
Omprakash Kukana 11-Dec-13 0:16am    
i want to bind data table i know how to bind grid view but data table binding is not working here
Omprakash Kukana 11-Dec-13 0:16am    
this is my code
DataTable table = new DataTable("ordettable");
IEnumerable<datarow> query = from st in obj.Book_details
where st.Category == "health"
select st;
BindingSource bindingSource1 = new BindingSource();
DataTable boundTable = query.CopyToDataTable<datarow>();
bindingSource1.DataSource = boundTable;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900