You must Sign In to post a response.
  • Category: .NET

    How to create Dynamic Dataset in

    Hi friends,
    I have one doubt regarding Generating dynamic dataset executing sp in Is it possible to create dynamic Dataset. if yes means how can we create and add the values from sp. becoz, i hav dynamic sp for running. based on sp running i have to create dataset. But Each dataset should contain each sp's output. then only it will help me do another process. Kindly guide me do this.
  • #761224
    Hello Karunanidhi,

    DataSet is collection of many DataTables. A DataSet is conceptually a set of DataTables and other information about those tables.

    Refer the below code :

    Dim con As New SqlConnection("Your connection string")
    Dim ds As New DataSet()
    Dim da As New SqlDataAdapter("SELECT Distinct(Item_Name) FROM ItemMaster", con)
    ComboBoxItemName.DataSource = ds.Tables(0)
    ComboBoxItemName.ValueMember = "Item_Name"
    ComboBoxItemName.DisplayMember = "Item_Name"
    ComboBoxItemName.SelectedIndex = -1
    Catch ex As Exception
    MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.[Error])
    End Try

    Hope this will help you.

    Nirav Lalan
    DNS Gold Member
    "Failure is the path of least persistence"

  • #761479

    Try this one also, by using this code we can add a dynamic dataset.

    Dim ds As New DataSet()
    Dim table As New DataTable("myTable")
    table.Columns.Add("column1", GetType(String))
    table.Columns.Add("column2", GetType(String))
    table.Rows.Add("a1", "b1")
    table.Rows.Add("a2", "b2")

    Still if you face problem then let me know.

    Dhiraj C. Solanki

Sign In to post your comments