Click here to Skip to main content
15,895,606 members
Home / Discussions / C#
   

C#

 
QuestionBackslash in C# string Pin
smsmfe6-Sep-07 4:01
smsmfe6-Sep-07 4:01 
AnswerRe: Backslash in C# string Pin
led mike6-Sep-07 4:22
led mike6-Sep-07 4:22 
AnswerRe: Backslash in C# string Pin
Guffa6-Sep-07 8:11
Guffa6-Sep-07 8:11 
GeneralRe: Backslash in C# string Pin
smsmfe6-Sep-07 20:09
smsmfe6-Sep-07 20:09 
QuestionA Generic error occured in GDI+ Pin
MSaeedJ6-Sep-07 3:43
MSaeedJ6-Sep-07 3:43 
AnswerRe: A Generic error occured in GDI+ Pin
Christian Graus6-Sep-07 3:45
protectorChristian Graus6-Sep-07 3:45 
GeneralRe: A Generic error occured in GDI+ Pin
MSaeedJ6-Sep-07 3:55
MSaeedJ6-Sep-07 3:55 
Questionupdating access database in C#2005 Pin
csanda16-Sep-07 3:38
csanda16-Sep-07 3:38 
Hi everyone

Im using c# 2005 and I want to update my access database, it can insert fine and has no errors but just does not update
Here's the code below

string strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=datatry.mdb";<br />
            OleDbCommand command = new OleDbCommand();<br />
            string bhala = "Update Table1 Set CompanyName ='"+txtCompany.Text+"' where CompanyName = '" + txtCompany.Text + "'";<br />
                            OleDbConnection datatryConn = new OleDbConnection(strConnection);<br />
                            datatryConn.Open();<br />
                            OleDbDataAdapter da = new OleDbDataAdapter(bhala, datatryConn);<br />
                            //DataSet ds = new DataSet();<br />
                            DataRow r = datatryds.Tables["Table1"].NewRow();<br />
                            //r["CompanyName"] = txtCompany.Text;<br />
                            datatryds.Tables["Table1"].Rows.Find(r);<br />
                            r.BeginEdit();<br />
                            r["CompanyName"] = txtCompany.Text;<br />
                            r.EndEdit();<br />
                            if (datatryds.HasChanges())<br />
                            {<br />
                                da.Update(datatryds, "Table1");<br />
                                datatryds.AcceptChanges();<br />
                            }<br />
                            OleDbCommandBuilder objCommandBuilder = new OleDbCommandBuilder(da);<br />
                            //da.Update(datatryds, "Table1");<br />
                            //this.table1TableAdapter.Update(this.datatryds.Table1);<br />
                            datatryConn.Close();<br />
                            MessageBox.Show("Updated successfully!");<br />


Thank you
any help is appreciated



csanda
AnswerRe: updating access database in C#2005 Pin
Ermak866-Sep-07 3:43
Ermak866-Sep-07 3:43 
AnswerRe: updating access database in C#2005 Pin
Christian Graus6-Sep-07 3:46
protectorChristian Graus6-Sep-07 3:46 
QuestionDesigning Advice Pin
sajid.salim.khan6-Sep-07 3:26
sajid.salim.khan6-Sep-07 3:26 
AnswerRe: Designing Advice Pin
Christian Graus6-Sep-07 3:29
protectorChristian Graus6-Sep-07 3:29 
Questionyee personal info Designing advice Pin
sajid.salim.khan6-Sep-07 3:21
sajid.salim.khan6-Sep-07 3:21 
AnswerRe: yee personal info Designing advice Pin
Christian Graus6-Sep-07 3:27
protectorChristian Graus6-Sep-07 3:27 
QuestionUsing the DoCmd.TransferSpreadsheet method Pin
c#_keithy6-Sep-07 3:04
c#_keithy6-Sep-07 3:04 
AnswerRe: Using the DoCmd.TransferSpreadsheet method Pin
Judah Gabriel Himango6-Sep-07 6:25
sponsorJudah Gabriel Himango6-Sep-07 6:25 
AnswerRe: Using the DoCmd.TransferSpreadsheet method Pin
DaveyM696-Sep-07 23:53
professionalDaveyM696-Sep-07 23:53 
Questiongetting Past School Firewalls Pin
SliverHive6-Sep-07 2:48
SliverHive6-Sep-07 2:48 
AnswerRe: getting Past School Firewalls Pin
MicealG6-Sep-07 2:54
MicealG6-Sep-07 2:54 
GeneralRe: getting Past School Firewalls Pin
SliverHive6-Sep-07 3:02
SliverHive6-Sep-07 3:02 
AnswerRe: getting Past School Firewalls Pin
J4amieC6-Sep-07 2:57
J4amieC6-Sep-07 2:57 
GeneralRe: getting Past School Firewalls Pin
SliverHive6-Sep-07 3:00
SliverHive6-Sep-07 3:00 
GeneralRe: getting Past School Firewalls Pin
J4amieC6-Sep-07 3:26
J4amieC6-Sep-07 3:26 
GeneralRe: getting Past School Firewalls Pin
SliverHive7-Sep-07 2:47
SliverHive7-Sep-07 2:47 
GeneralRe: getting Past School Firewalls Pin
Pete O'Hanlon9-Sep-07 9:24
mvePete O'Hanlon9-Sep-07 9:24 

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.