473,506 Members | 17,100 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to add combobox to a datagrid

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!!!!!
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...b-net/200507/1
Nov 21 '05 #1
2 1044
Ivan V via DotNetMonster.com schrieb:
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
Nov 21 '05 #2
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()
--
Message posted via http://www.dotnetmonster.com
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1405
by: Gamze | last post by:
Hi, In my vb.net windows application ,i have combobox which is populated by sqlserver database table.When i select value from combobox ,value saved in to other table of my database and i use to...
3
4236
by: Bill C. | last post by:
Hello, I know this has been discussed a lot already because I've been searching around for information the last few weeks. I'm trying to implement a DataGridComboBoxColumn class. I've found...
2
2366
by: john sutor | last post by:
Does anyone know how to create a combobox in a standard datagrid? I can create check boxes , but not the combobox
3
3016
by: PeterZ | last post by:
G'day, After doing much searching and pinching bits of ideas from here there and everywhere I came up with a fairly 'clean' solution of including a comboBox into a dataGrid column. You can...
2
4316
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know...
3
6805
by: TT (Tom Tempelaere) | last post by:
Hay there, I'm writing my own DataGridComboBoxColumn because .NET 1.1 does not have one (I hope .NET 2.0 supplies one). I based it on this article:...
1
1458
by: John Doe | last post by:
Now i know how to manually add a combobox to a datagrid, but how would i handle the recordset below? ID | FirstName | LastName | Job -------------------------------- 1 |Joe | Smith |...
0
407
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a...
1
2081
by: fiaolle | last post by:
Hi The first set of source code is the class for a combobox in a grid, hopefully. In the second set of code we try to use the combobox class, but the grid is empty. I don't understand how this...
4
1807
by: JJGarcia | last post by:
Hi Everyone, I'll try to explain the process I'm following, I'm new to this so I'm triying the easy way first, probably the lasyest too! I created a new Project, drag in to it a SQLConnection,...
0
7220
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7308
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7023
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7479
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5037
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1534
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.