A
Angelina
Hi,
Im in need of your help once again. I am truing to run a
stored procudure to fill a datagrid. However i keep
encountering the following error:
An unhandled exception of
type 'System.Data.SqlClient.SqlException' occurred in
system.data.dll
Additional information: System error.
the code stope on this line:
da.Fill(ds, "CaraEquip")
here is my full code. can anyone please tell me what im
doin wrong?
Private Sub RBtnEquipYes_CheckedChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
RBtnEquipYes.CheckedChanged
Dim Cn As New SqlConnection("data
source=PARAGLAPTOP\VSdotNET;initial
catalog=CaravanDBLapSQLServ;integrated
security=SSPI;persist security info=False;workstation
id=PARAGLAPTOP;packet size=4096")
Dim cmdCaraEquip As New SqlCommand("SPSelCaraEquip", Cn)
cmdCaraEquip.CommandType =
CommandType.StoredProcedure
cmdCaraEquip.Parameters.Add("@CaraName",SqlDbType.Char, 50)
cmdCaraEquip.Parameters("@CaraName").Value =
CBoxDisCaraNames.SelectedItem
da = New SqlDataAdapter("SPSelCaraEquip", Cn)
ds = New DataSet("CaraEquip")
da.Fill(ds, "CaraEquip")
DataGridEquip.DataSource = ds.Tables(0)
Dim TSCaraEquip As New DataGridTableStyle()
TSCaraEquip.MappingName = "CaraEquip"
Dim TCEquipName As New DataGridTextBoxColumn()
TCEquipName.MappingName = "Equip_Name"
TCEquipName.HeaderText = "Equipment Name"
TCEquipName.Width = 150
TCEquipName.ReadOnly = True
TSCaraEquip.GridColumnStyles.Add(TCEquipName)
DataGridEquip.TableStyles.Add(TSCaraEquip)
DataGridEquip.CaptionText = "Select the meals you wish to
book:"
If RBtnEquipYes.Checked = True Then DataGridEquip.Visible
= True
thx
Im in need of your help once again. I am truing to run a
stored procudure to fill a datagrid. However i keep
encountering the following error:
An unhandled exception of
type 'System.Data.SqlClient.SqlException' occurred in
system.data.dll
Additional information: System error.
the code stope on this line:
da.Fill(ds, "CaraEquip")
here is my full code. can anyone please tell me what im
doin wrong?
Private Sub RBtnEquipYes_CheckedChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
RBtnEquipYes.CheckedChanged
Dim Cn As New SqlConnection("data
source=PARAGLAPTOP\VSdotNET;initial
catalog=CaravanDBLapSQLServ;integrated
security=SSPI;persist security info=False;workstation
id=PARAGLAPTOP;packet size=4096")
Dim cmdCaraEquip As New SqlCommand("SPSelCaraEquip", Cn)
cmdCaraEquip.CommandType =
CommandType.StoredProcedure
cmdCaraEquip.Parameters.Add("@CaraName",SqlDbType.Char, 50)
cmdCaraEquip.Parameters("@CaraName").Value =
CBoxDisCaraNames.SelectedItem
da = New SqlDataAdapter("SPSelCaraEquip", Cn)
ds = New DataSet("CaraEquip")
da.Fill(ds, "CaraEquip")
DataGridEquip.DataSource = ds.Tables(0)
Dim TSCaraEquip As New DataGridTableStyle()
TSCaraEquip.MappingName = "CaraEquip"
Dim TCEquipName As New DataGridTextBoxColumn()
TCEquipName.MappingName = "Equip_Name"
TCEquipName.HeaderText = "Equipment Name"
TCEquipName.Width = 150
TCEquipName.ReadOnly = True
TSCaraEquip.GridColumnStyles.Add(TCEquipName)
DataGridEquip.TableStyles.Add(TSCaraEquip)
DataGridEquip.CaptionText = "Select the meals you wish to
book:"
If RBtnEquipYes.Checked = True Then DataGridEquip.Visible
= True
thx