473,480 Members | 3,098 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Datagridviewcombobox

2 New Member
The code is not running.Datagrid is not displaying anything.
I HAVE A COLUMN CALLED QUALIFICATION IN MY DATABASE HAVING DATA BTECH,MCA.I WANT TO SHOW THAT IN COMBO BOX IN DATAGRID.HOW TO SHOW.THIS IS MY CODE


SqlConnection con = new SqlConnection("Data Source=AMIT\\SQLEXPRESS;Initial Catalog=amit;Integrated Security=True");
SqlDataAdapter da = new SqlDataAdapter("select name,id,salary from employ ", con);
DataSet ds= new DataSet();
da.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
textBox1.DataBindings.Add("text", ds.Tables[0], "name");
textBox2.DataBindings.Add("text", ds.Tables[0], "id");
textBox3.DataBindings.Add("text", ds.Tables[0], "salary");

DataGridViewComboBoxColumn car=new DataGridViewComboBoxColumn ();


car.DataSource = ds.Tables["EMPLOY"];
car.DisplayMember = "QUALIFICATION";
car.ValueMember = "id";
car.DataPropertyName = "quali";
dataGridView1.Columns.Add(car);
Mar 6 '12 #1
0 1076

Sign in to post your reply or Sign up for a free account.

Similar topics

2
4008
by: dimension | last post by:
Hi, i have one question and one opinion i seek. please assist if you can. I am using VS2005 beta. 1) I have two tables with the following columns Security: security_id, name, symbol, exchange_id...
1
320
by: perspolis | last post by:
Hi All I used datagridviewcombostyle for my application.. but it shows the combobox style in DropDownList style..I want to be able to enter data into it,,how can I have combobox dropdown ?? ...
1
2562
by: ashok76 | last post by:
Hi I've a DataGridView and where has column 0 is a DataGridViewComboBoxColumn Whenever I selected that cell then the drop down list not appeared on single click event hence I need to click again...
1
2373
by: tim8w via DotNetMonster.com | last post by:
I am using a DataGridViewComboBox in a DataGridView. When a user selects a radio button, I would like to clear all the items in the DataGridViewComboBox and repopulate with new values. I do this as...
0
835
by: DominicHelen | last post by:
I am doing c# .net windows application. I have three forms which are load one by one using : Thread t = new Thread(new ThreadStart(StartInterviewThread)); t.start(); public void...
3
3153
by: DominicHelen | last post by:
I have used this following: private void EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { DataGridViewComboBoxEditingControl cbo = e.Control as...
0
1016
by: DominicHelen | last post by:
I have a datagridviewcomboboxcolumn with that I can type a new value which is not in the drop down list. But I can not type a value which is in the list with keyboard. I can only scroll down to...
0
1256
by: gotonagle | last post by:
Hi i am working in vb.net with datagridview. the problem is if i set the EditMode property of datagrid to "EditOnKeyStrokeOrF2" then to select the dropdown we have to click three times on it and if...
2
1079
by: arevans | last post by:
I have a datagridview with two comboboxcolumns. I want the combobox in column B to be dynamically filled with data from the database depending on which item is selected in column A. How do I go...
1
4497
Plater
by: Plater | last post by:
I feel like this question has been asked before, but I couldn't find it. I think I am missing something obvious. Basically I am going to have a DataGridView with two columns. One textbox, one...
0
7055
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
6920
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7110
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7030
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
5367
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,...
0
4503
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
3011
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1313
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 ...
0
210
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.