Click here to Skip to main content
15,909,440 members
Home / Discussions / C#
   

C#

 
GeneralRe: Working with percentages in C# Pin
Vikram A Punathambekar16-Apr-08 18:39
Vikram A Punathambekar16-Apr-08 18:39 
AnswerRe: Working with percentages in C# Pin
Simon P Stevens16-Apr-08 23:10
Simon P Stevens16-Apr-08 23:10 
Generalstring to float problem Pin
Xmen Real 16-Apr-08 18:03
professional Xmen Real 16-Apr-08 18:03 
GeneralRe: string to float problem Pin
Christian Graus16-Apr-08 18:33
protectorChristian Graus16-Apr-08 18:33 
GeneralRe: string to float problem Pin
Brady Kelly16-Apr-08 22:35
Brady Kelly16-Apr-08 22:35 
GeneralRe: string to float problem Pin
Xmen Real 16-Apr-08 22:43
professional Xmen Real 16-Apr-08 22:43 
GeneralRe: string to float problem Pin
ChrisKo17-Apr-08 7:56
ChrisKo17-Apr-08 7:56 
GeneralProblem in Update dataset to database using oledbadapter Pin
cocoonwls16-Apr-08 17:22
cocoonwls16-Apr-08 17:22 
Hi all,

In my app i have 1 class call sqlconnection which is use for get/update db data. I am use this class to get dataset and after i edit the dataset i will pass back to this class and update it.Example, call sqlconnection method from formA to get and update database:

class sqlconnection:

private OleDbConnection objConn;<br />
  private OleDbDataAdapter objAdapter = new OleDbDataAdapter();<br />
<br />
  public void DbConnection()<br />
  {<br />
    objConn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;DataSource=Userprogram.mdb");<br />
  }<br />
<br />
  public DataSet SelectSQL(String stable,String sProgramName)<br />
  {<br />
    DataSet ds=new DataSet();<br />
    objConn.Open();<br />
    objCmdSelecte = new OleDbCommand("Select * From Timeway where TW_Program_Name ='" +  sProgramName + "'", objConn);<br />
                <br />
    objAdapter.SelectCommand = objCmdSelecte;<br />
    objAdapter.Fill(ds);<br />
    objConn.Close();<br />
    return ds;<br />
   }<br />
<br />
   public void UpdateSQL(DataSet ds)<br />
   {<br />
     objConn.Open();<br />
     objAdapter.Update(ds);<br />
     objConn.Close();<br />
   }


formA:
sqlconn.DbConnection();<br />
   ds = sqlconn.SelectSQL("PS", "Program Ni");<br />
      for (int i = 0; i < 16;i++ )<br />
        {<br />
            ArrayData[i] = ArrayTextbox[i].Text;     //insert modified value<br />
            ds.Tables[0].Rows[0][i + 1] = ArrayData[i];<br />
        }<br />
      ds.AcceptChanges();<br />
      sqlconn.UpdateSQL(ds);


The problem i am facing is , nothing change to my database.I have already check the dataset which is pass to my sqlconnection class and it have been modified. So what i guess is the problem of objAdapter.update. Can anyone guide me to solve this problem?Confused | :confused:


thanks in advance
cocoon
GeneralRe: Problem in Update dataset to database using oledbadapter Pin
cocoonwls16-Apr-08 21:29
cocoonwls16-Apr-08 21:29 
QuestionComparing enums? Pin
kumar.bs16-Apr-08 14:29
kumar.bs16-Apr-08 14:29 
AnswerRe: Comparing enums? Pin
Christian Graus16-Apr-08 15:15
protectorChristian Graus16-Apr-08 15:15 
AnswerRe: Comparing enums? Pin
Ravenet16-Apr-08 15:41
Ravenet16-Apr-08 15:41 
GeneralRe: Comparing enums? Pin
Christian Graus16-Apr-08 15:43
protectorChristian Graus16-Apr-08 15:43 
GeneralRe: Comparing enums? Pin
Ravenet16-Apr-08 15:50
Ravenet16-Apr-08 15:50 
GeneralRe: Comparing enums? Pin
Christian Graus16-Apr-08 15:57
protectorChristian Graus16-Apr-08 15:57 
GeneralRe: Comparing enums? Pin
Ravenet16-Apr-08 16:00
Ravenet16-Apr-08 16:00 
GeneralRe: Comparing enums? Pin
Christian Graus16-Apr-08 16:10
protectorChristian Graus16-Apr-08 16:10 
GeneralRe: Comparing enums? Pin
Ravenet16-Apr-08 16:13
Ravenet16-Apr-08 16:13 
GeneralRe: Comparing enums? Pin
Christian Graus16-Apr-08 16:30
protectorChristian Graus16-Apr-08 16:30 
GeneralRe: Comparing enums? Pin
Ravenet16-Apr-08 16:34
Ravenet16-Apr-08 16:34 
GeneralRe: Comparing enums? Pin
AndrewVos16-Apr-08 21:30
AndrewVos16-Apr-08 21:30 
GeneralRe: Comparing enums? Pin
AndrewVos16-Apr-08 21:38
AndrewVos16-Apr-08 21:38 
QuestionLaunching an external process from a BackgroundWorker thread? Pin
thompsons16-Apr-08 13:09
thompsons16-Apr-08 13:09 
GeneralRe: Launching an external process from a BackgroundWorker thread? Pin
Luc Pattyn16-Apr-08 14:37
sitebuilderLuc Pattyn16-Apr-08 14:37 
GeneralRe: Launching an external process from a BackgroundWorker thread? Pin
Ravenet16-Apr-08 16:04
Ravenet16-Apr-08 16:04 

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.