Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
QuestionHow to get the value from a variable and use it eg Form.VariableValue Pin
MarkB1235-Mar-09 5:53
MarkB1235-Mar-09 5:53 
AnswerRe: How to get the value from a variable and use it eg Form.VariableValue Pin
Xmen Real 5-Mar-09 5:57
professional Xmen Real 5-Mar-09 5:57 
GeneralRe: How to get the value from a variable and use it eg Form.VariableValue Pin
MarkB1235-Mar-09 8:06
MarkB1235-Mar-09 8:06 
QuestionHow to link the current website to your textbox ? Pin
YiXiang_895-Mar-09 5:52
YiXiang_895-Mar-09 5:52 
QuestionOledbException when trying to Insert values in two combobox Pin
haroon19805-Mar-09 5:44
haroon19805-Mar-09 5:44 
AnswerRe: OledbException when trying to Insert values in two combobox Pin
Yusuf5-Mar-09 8:07
Yusuf5-Mar-09 8:07 
GeneralRe: OledbException when trying to Insert values in two combobox Pin
haroon19805-Mar-09 12:24
haroon19805-Mar-09 12:24 
GeneralRe: OledbException when trying to Insert values in two combobox Pin
haroon19805-Mar-09 23:52
haroon19805-Mar-09 23:52 
I got the solution of how to tackle and did it by doing SQL query again to be bit corrected..and now no exception...

private void Form1_Load(object sender, EventArgs e)
        {
            
            string sql ="SELECT distinct ProductName FROM Products";
            string sql2 = "SELECT DISTINCT Packing.PackingName FROM Packing INNER JOIN Products ON Packing.PackingID=Products.Packing";
            

			DataSet ds=new DataSet();
            
            
			try 
			{
				database = new OleDbConnection(connectionString);
                database.Open();
			}
			catch (Exception x)
			{
				MessageBox.Show(x.Message);
			}
			
            OleDbDataAdapter adp = new OleDbDataAdapter(sql, database);
            adp.Fill(ds, "ProductName");

            adp = new OleDbDataAdapter(sql2, database);
            adp.Fill(ds,"PackingName");
							
			foreach (DataRow dr in ds.Tables[0].Rows) 
			{
				comboBox3.Items.Add(dr[0].ToString()) ;
                                comboBox1.Items.Add(dr[1].ToString());
             		
			}


But now in combobox1 i get the same values as in combobox3? Confused | :confused:
I think so pb in foreach loop?

Any advise please...
QuestionLotus Notes (ConvertMIME) Pin
tomas cook5-Mar-09 4:46
tomas cook5-Mar-09 4:46 
AnswerRe: Lotus Notes (ConvertMIME) Pin
tomas cook11-Mar-09 0:47
tomas cook11-Mar-09 0:47 
QuestionHow to insert into Master/Details at the same time ? Pin
hdv2125-Mar-09 4:26
hdv2125-Mar-09 4:26 
AnswerRe: How to insert into Master/Details at the same time ? Pin
Eddy Vluggen5-Mar-09 4:45
professionalEddy Vluggen5-Mar-09 4:45 
GeneralRe: How to insert into Master/Details at the same time ? Pin
hdv2125-Mar-09 4:50
hdv2125-Mar-09 4:50 
GeneralRe: How to insert into Master/Details at the same time ? Pin
Eddy Vluggen5-Mar-09 5:11
professionalEddy Vluggen5-Mar-09 5:11 
GeneralRe: How to insert into Master/Details at the same time ? Pin
hdv2125-Mar-09 5:59
hdv2125-Mar-09 5:59 
GeneralRe: How to insert into Master/Details at the same time ? Pin
Eddy Vluggen5-Mar-09 6:36
professionalEddy Vluggen5-Mar-09 6:36 
GeneralRe: How to insert into Master/Details at the same time ? Pin
hdv2125-Mar-09 10:01
hdv2125-Mar-09 10:01 
GeneralRe: How to insert into Master/Details at the same time ? Pin
jaypatel5128-Mar-09 5:17
jaypatel5128-Mar-09 5:17 
Questioncustom property item in PropertyGrid Pin
dilipmca045-Mar-09 4:25
dilipmca045-Mar-09 4:25 
AnswerRe: custom property item in PropertyGrid Pin
netJP12L5-Mar-09 7:12
netJP12L5-Mar-09 7:12 
AnswerRe: custom property item in PropertyGrid Pin
Dragonfly_Lee5-Mar-09 18:22
Dragonfly_Lee5-Mar-09 18:22 
QuestionRun EXE from Remote machine in client machine... Pin
siva4555-Mar-09 4:09
siva4555-Mar-09 4:09 
AnswerRe: Run EXE from Remote machine in client machine... [modified] Pin
Mirko19805-Mar-09 4:35
Mirko19805-Mar-09 4:35 
GeneralRe: Run EXE from Remote machine in client machine... Pin
Tomas De Boever2-May-09 4:17
Tomas De Boever2-May-09 4:17 
AnswerRe: Run EXE from Remote machine in client machine... Pin
Yusuf5-Mar-09 5:48
Yusuf5-Mar-09 5:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.