how to add combobox to a datagrid

  • Thread starter Thread starter Ivan V via DotNetMonster.com
  • Start date Start date
I

Ivan V via DotNetMonster.com

Dear All:

I got another programming problem on using the combobox in a datagrid. My
programming code is as follow:

Data_sh.Visible = True
kn = New SqlConnection("Data Source=NTSVR4;" & _
"Initial Catalog= cashier; User ID =
newapp; Password = newapp2005;")

ka.SelectCommand = New SqlCommand("Select chtype.ch_name as
C_TYPE, " & _
"cast(pousadt.amt as
varchar(12)) as AMOUNT, " & _
"paytype.pay_name as P_TYPE,
" & _
"pousadt.f_no as F_NO, " &
_
"pousadt.rec_no as T_NO, "
& _
"pousadt.slip_no as FB_NO,
" & _
"pousadt.dep_no as DEP_NO "
& _
"from pousadt inner join
chtype on " & _
"chtype.ch_type = pousadt.
ch_type inner join " & _
"paytype on paytype.
pay_type = pousadt.pay_type " & _
"where pousadt.ref_no = " &
"'" & silly$ & "'" & _
" and pousadt.gst_code = "
& "'" & tmp$ & "'", kn)
Dim ks As New DataSet()

If ka.Fill(ks, "pousadt") = False Then
Else
Data_sh.DataSource = ks
Data_sh.DataMember = "pousadt"
End If
kn.Close()

Anyone could help me out for the rest of the code??? Thanks a lot!!!!!
 
Ivan said:
Dear All:

I got another programming problem on using the combobox in a datagrid. My
programming code is as follow:

Please reformat the code. It is hard to read.

Armin
 
Here is the code again...


Data_sh.Visible = True
kn = New SqlConnection("Data Source=NTSVR4;" & _
"Initial Catalog= cashier; User
ID = newapp; Password = newapp2005;")

ka.SelectCommand = New SqlCommand("Select chtype.ch_name as C_TYPE, " & _
"cast(pousadt.amt as varchar
(12)) as AMOUNT, " & _
"paytype.pay_name as P_TYPE,
" & _
"pousadt.f_no as F_NO, " &_
"pousadt.rec_no as T_NO, "&
_
"pousadt.slip_no as FB_NO,"
& _
"pousadt.dep_no as DEP_NO "&
_
"from pousadt inner
joinchtype on " & _
"chtype.ch_type = pousadt.
ch_type inner join " & _
"paytype on paytype.pay_type
= pousadt.pay_type " & _
"where pousadt.ref_no = "
&"'" & silly$ & "'" & _
" and pousadt.gst_code = "&
"'" & tmp$ & "'", kn)
Dim ks As New DataSet()

If ka.Fill(ks, "pousadt") = False Then
Else
Data_sh.DataSource = ks
Data_sh.DataMember = "pousadt"
End If
kn.Close()
 
Back
Top