none
DataSet Generation Error RRS feed

  • Question

  • Hi..

    I am using visual studio 2008 for development. When i create a dataset using Table Adapter configuration and SQL Stored Procedures, the Columns for the DataTable is not generated automatically.

    I am using Temp tables and written some logics inside the SP.

    Can anyone tell, how to get the columns from the stored procedure..

    Thanks in Advance
    Best Regards,
    Gopi V

    If you have found this post helpful, please click the Vote as Helpful link (the green triangle and number on the top-left).

    If this post answers your question, click the Mark As Answered link below. It helps others who experience the same issue in future to find the solution.

    Wednesday, January 13, 2010 7:44 AM

All replies

  • Hi..

    I am using visual studio 2008 for development. When i create a dataset using Table Adapter configuration and SQL Stored Procedures, the Columns for the DataTable is not generated automatically.

    I am using Temp tables and written some logics inside the SP.

    Can anyone tell, how to get the columns from the stored procedure..

    Thanks in Advance
    Best Regards,
    Gopi V

    If you have found this post helpful, please click the Vote as Helpful link (the green triangle and number on the top-left).

    If this post answers your question, click the Mark As Answered link below. It helps others who experience the same issue in future to find the solution.


    you shoud be using like this

    tAdapter.Fill(dsObj);

    but before this line you must have

    command cmd = new command("sp_getSomeData");//procedure name
    cmd.Type = Command.StoredProcedure;// this is command type which is Important in case of SP calls

    tAdapter.SelectCommand = cmd ;

    try like this


    Thanks Mike --------Please mark as answer if it is useful----------
    Friday, January 15, 2010 4:45 AM
  • No... My Actual Problem is the Visual Studio DataSet Generator.

    Its not about my Code. When I drag a Normal Table from the Data Exporer Window into the DataSet, the Columns are Automatically Generated. Also it is creating columns for Certain SP's Also.

    But, For the SP's with those Kind of Code is Not Creating Columns in the DataSet.

    I hope now i made my point clear.

    Best Regards,
    Gopi V

    If you have found this post helpful, please click the Vote as Helpful link (the green triangle and number on the top-left).

    If this post answers your question, click the Mark As Answered link below. It helps others who experience the same issue in future to find the solution.

    Wednesday, January 20, 2010 2:35 PM
  • Also it is creating columns for Certain SP's Also.
    what is the sp, can you post here?


    For the SP's with those Kind of Code is Not Creating Columns in the DataSet.
    Results will be stored in a datatable, later that table will be attached to dataset. Without running sp, how can you see the columns? When you write a sp with specific column values, probably you can see the columns, but what about you query for all fields, which you don't know how many?? . I guess you are facing this situation


    Thanks Mike --------Please mark as answer if it is useful----------
    Thursday, January 21, 2010 10:11 AM
  • Hi Mike,

    Just Add a New DataSet In the Application.

    From the Server Explorer Pull any SP From Northwind DataBase and put inside the DataSet Window.

    It will automatically executes the SP and Create the DataTable with the SP Returning Columns including the TableAdapter.

    In the Same way Create your Own SP with some logics Inside Including #temp Table, and Drag the same SP, the Columns are Not Created.. Instead it will create the Query Adapter.

    I am facing the Issue with the DataSet Designer.... Not in My own Code.

    Thanks.
    Best Regards,
    Gopi V

    If you have found this post helpful, please click the Vote as Helpful link (the green triangle and number on the top-left).

    If this post answers your question, click the Mark As Answered link below. It helps others who experience the same issue in future to find the solution.

    Thursday, January 21, 2010 11:45 AM
  • if you are using mySQL check these steps http://www.devart.com/dotconnect/mysql/docs/DataSetWizard.html

    In general, unless you have change the default query, you use

    MyDataTable = MyTableAdapter.GetData();

    This produces an "every row in the table" DataSet. You can create a Get method every time you create a new query. There is also a fill method, but it works like this:

    MyDataTable table = new MyDataTable():
    MyTableAdapter.Fill(table);


    Thanks Mike --------Please mark as answer if it is useful----------
    Friday, January 22, 2010 5:25 AM
  • have u got a solution?


    Thanks Mike --------Please mark as answer if it is useful----------
    Sunday, February 7, 2010 7:21 PM