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

C#

 
GeneralRe: How to use a COM Interface Dll within C# code??? Pin
Dragonfly_Lee6-Mar-09 2:41
Dragonfly_Lee6-Mar-09 2:41 
GeneralRe: How to use a COM Interface Dll within C# code??? Pin
lane0p26-Mar-09 4:45
lane0p26-Mar-09 4:45 
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 
shah123 wrote:
OleDbDataAdapter adp=new OleDbDataAdapter(sql,database); adp = new OleDbDataAdapter(sql2,database);


you are using the same data adapter for box queries. Is this what you want to do?

You need to process the first data adapter before reusing it or use different data adapter, even better, refactor your code and call it as many times as you want, for example

FillComboBox(comboBox, sql)
    {
      DataSet ds = new DataSet(); 
      try 
      { 
        database = new OleDbConnection(connectionString); 
        database.Open();

        OleDbDataAdapter adp = new OleDbDataAdapter(sql, database); 
        adp.Fill(ds, "tableName");         
        
        foreach (DataRow dr in ds.Tables[0].Rows) 
        { 
          comboBox.Items.Add(dr[0].ToString()); 
        }
      }
      catch (Exception x) 
      { 
        MessageBox.Show(x.Message); 
      }
    }


Yusuf

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 
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 

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.