Note that there are some explanatory texts on larger screens.

plurals
  1. POPopulating datagrid1.view with a SQL Server stored procedure
    primarykey
    data
    text
    <p>I got a stored procedure in SQL Server I created some inner joins and now how will I populate my datagrid using that stored procedure.</p> <p>Here is my code that is not working</p> <pre><code>Dim cmd As New SqlCommand Dim reader As SqlDataReader cmd.CommandText = "OfficeEquipmentProfile" cmd.CommandType = CommandType.StoredProcedure cmd.Connection = sqlconn sqlconn.Open() sAdapter = New SqlDataAdapter(cmd) sBuilder = New SqlCommandBuilder(sAdapter) sDs = New DataSet sAdapter.Fill(sDs, "tblOfficeEquipmentProfile") sAdapter.Fill(sDs, "tblDepartment") sAdapter.Fill(sDs, "tblLocation") sAdapter.Fill(sDs, "tblOfficeEquipmentCategory") sAdapter.Fill(sDs, "tblApplication") sAdapter.Fill(sDs, "tblApplicationLicense") sAdapter.Fill(sDs, "tblEquipmentApplication") sAdapter.Fill(sDs, "tblOfficeEquipmentBrand") sAdapter.Fill(sDs, "tblOfficeEquipmentModel") sAdapter.Fill(sDs, "tblOfficeEquipmentServiceOrder") sAdapter.Fill(sDs, "tblOfficeEquipmentPMplan") sTable = sDs.Tables("tblOfficeEquipmentProfile") sTable = sDs.Tables("tblDepartment") sTable = sDs.Tables("tblLocation") sTable = sDs.Tables("tblOfficeEquipmentCategory") sTable = sDs.Tables("tblApplication") sTable = sDs.Tables("tblApplicationLicense") sTable = sDs.Tables("tblEquipmentApplication") sTable = sDs.Tables("tblOfficeEquipmentBrand") sTable = sDs.Tables("tblOfficeEquipmentServiceOrder") sTable = sDs.Tables("tblOfficeEquipmentPMplan") DataGrid1.DataSource = sDs.Tables("tblOfficeEquipmentProfile, tblDepartment, tblLocation, tblOfficeEquipmentCategory, tblApplication,tblApplicationLicense, tblEquipmentApplication, tblOfficeEquipmentBrand, tblOfficeEquipmentServiceOrder,tblEquipmentPMplan") DataGrid1.ReadOnly = True 'Button1.Enabled = False 'DataGrid1.SelectionMode = DataGridViewSelectionMode.FullRowSelect reader = cmd.ExecuteReader() sqlconn.Close() </code></pre> <p>I just want to display records from the database</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload