Andrew MC

Andrew MC

  • NA
  • 5
  • 5.8k

Creating datatables in a windows forms app?

Aug 6 2014 4:41 AM
hi friends,

i can create an ado .net datatable either by the designer or by code for an existing stored procedure in the DB. Assume i have several stored procedures at the back end for data retrieval. Assume there are 10 stored procedures. So in my Datatset there should be 10 datatables. Assume some of those datatables have foreign keys (foreign keys in the DB but not set as foreign keys in the datatables). So datatables can be connected. If i compare with teh SQL tables, Assume Products, Categories and Suppliers tables, products table can be connected with Category and Suppliers tables. Assume there is stored procedure to return all product information with their categories, so one store procedure return a set of data of two tables. So if i make a datatable from this stored procedure it contains data from two DB tables Products and Categories. Also there is another stored procedure that returns all category information. So if i need to create a datatable from this stored procedure it will hold all the category information returned by the second stored procedure. Furthermore in the database those two DB tables Products and categories are linked but likewise should i link the datatables ProductInformation and CategoriesInformations?

When ProductInformation table has all product information along with their category information Is there a point of linking ProductInformation datatable and CategoryInformation datatable?

I have asked this question because i have seen people linking those two datatables!

thanks