Click here to Skip to main content
15,922,533 members
Home / Discussions / C#
   

C#

 
AnswerRe: Mark field in child class as NonSerialized Pin
deyaert21-Dec-08 23:42
deyaert21-Dec-08 23:42 
GeneralRe: Mark field in child class as NonSerialized Pin
Dust Signs21-Dec-08 23:51
Dust Signs21-Dec-08 23:51 
GeneralRe: Mark field in child class as NonSerialized Pin
deyaert22-Dec-08 0:31
deyaert22-Dec-08 0:31 
GeneralRe: Mark field in child class as NonSerialized Pin
Dust Signs22-Dec-08 0:39
Dust Signs22-Dec-08 0:39 
GeneralRe: Mark field in child class as NonSerialized Pin
deyaert22-Dec-08 0:58
deyaert22-Dec-08 0:58 
GeneralRe: Mark field in child class as NonSerialized Pin
Dust Signs22-Dec-08 1:01
Dust Signs22-Dec-08 1:01 
GeneralRe: Mark field in child class as NonSerialized Pin
deyaert22-Dec-08 1:02
deyaert22-Dec-08 1:02 
QuestionHow can I update rows in a table using OLEDB in C#? Pin
dliviu21-Dec-08 22:39
dliviu21-Dec-08 22:39 
I just don't get it why is it so complex to make a simple update...
I want trough a procedure to modify all the rows in a table like so: suppose I have a table with colums a, b, and c. c is identified by a and b. The procedure has the parameters a,b and c.
a,b,c
Example: UpdateazaCantCont(1,3,5) must add 5 to the old value of c. So if one row in the database table values are 1,3,8 the new values must be 1,3,13.

Please help me, because I'm in an death stop in my project!
The procedure i've wrote gives me no error, but it doesnt do anything.
Here's the code I have written:

private void UpdateazaCantCont(string aVal, string bVal, int cVal)
{
DataSet mds = new DataSet();

OleDbDataAdapter mda = new OleDbDataAdapter("select * from table where a='" + aVal + "'and b='" + bVal + "'", sirConex);

mda.Fill(mds,"continut_locatie");

DataTable t = mds.Tables[0];
DataRow[] r = t.Select("a='"+aVal+"b='"+ bVal + "'");
for (int i=0; i<r.length;>
string sirUpdate = "Update table set c=c+'"+cVal+"'where a='" + aVal + " and b='" + bVal + "'";
OleDbConnection myConex = new OleDbConnection(sirConex);

OleDbCommand cmd = new OleDbCommand(sirUpdate, myConex);


cmd.CommandText = sirUpdate;
mda.UpdateCommand = cmd;

try
{
mda.Update(mds, "table");
}
catch (Exception ex)
{
MessageBox.Show("Eroare: " + ex);
}

}
AnswerRe: How can I update rows in a table using OLEDB in C#? Pin
Christian Graus21-Dec-08 22:45
protectorChristian Graus21-Dec-08 22:45 
GeneralRe: How can I update rows in a table using OLEDB in C#? Pin
dliviu21-Dec-08 22:55
dliviu21-Dec-08 22:55 
GeneralRe: How can I update rows in a table using OLEDB in C#? Pin
Christian Graus21-Dec-08 23:04
protectorChristian Graus21-Dec-08 23:04 
QuestionException of file encryption using c# Pin
cat ang21-Dec-08 21:04
cat ang21-Dec-08 21:04 
AnswerRe: Exception of file encryption using c# Pin
Christian Graus21-Dec-08 22:42
protectorChristian Graus21-Dec-08 22:42 
GeneralRe: Exception of file encryption using c# Pin
cat ang22-Dec-08 2:16
cat ang22-Dec-08 2:16 
GeneralRe: Exception of file encryption using c# Pin
Colin Angus Mackay22-Dec-08 2:48
Colin Angus Mackay22-Dec-08 2:48 
AnswerRe: Exception of file encryption using c# Pin
Colin Angus Mackay22-Dec-08 2:46
Colin Angus Mackay22-Dec-08 2:46 
GeneralRe: Exception of file encryption using c# Pin
cat ang22-Dec-08 4:03
cat ang22-Dec-08 4:03 
Questionzedgraph Pin
hamidhakimi21-Dec-08 21:04
hamidhakimi21-Dec-08 21:04 
AnswerRe: zedgraph Pin
Garth J Lancaster21-Dec-08 22:35
professionalGarth J Lancaster21-Dec-08 22:35 
Questionhow to identify the button which is clicked Pin
prasadbuddhika21-Dec-08 20:28
prasadbuddhika21-Dec-08 20:28 
AnswerRe: how to identify the button which is clicked Pin
N a v a n e e t h21-Dec-08 20:41
N a v a n e e t h21-Dec-08 20:41 
AnswerRe: how to identify the button which is clicked Pin
Christian Graus21-Dec-08 20:51
protectorChristian Graus21-Dec-08 20:51 
Questionimage processing Pin
komathyc21-Dec-08 20:21
komathyc21-Dec-08 20:21 
AnswerRe: image processing Pin
Christian Graus21-Dec-08 20:51
protectorChristian Graus21-Dec-08 20:51 
QuestionServer path from DLL Pin
yesu prakash21-Dec-08 20:03
yesu prakash21-Dec-08 20:03 

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.