sasa lazic

sasa lazic

  • NA
  • 104
  • 49.9k

c# update mdb

Sep 27 2014 1:25 PM
Hi people,
 
I am create table in access mdb with name Potrazivanje.
Than i create 3 columns and fill it with data.
Columns name in table Potrazivanje UserName, Order, Field3
What i want ?
 
I want find  in table Potrazivanje UserName and insert text string in
Field3 who is in same row as UserName.
 
I try with this but i get some error with command string
 
string baza = dostupno.alpoExePath + "\\" + "alpo_doo_database.mdb";
string conAccSt = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="; OleDbConnection conn = null;
conn = new OleDbConnection(conAccSt + baza);
conn.Open();
string st = comboBox1.Text;
OleDbCommand update = new OleDbCommand("UPDATE Potrazivanje SET Uneo = '" + Order + "', WHERE UserName= '" + st + "'", conn);
update.ExecuteNonQuery();
conn.Close();
 
I use winForms 
 
Thanks for Help 

Answers (2)