Click here to Skip to main content
15,896,912 members
Home / Discussions / C#
   

C#

 
Questionconfusion with datatable sorting/finding Pin
melanieab21-Sep-05 7:49
melanieab21-Sep-05 7:49 
AnswerRe: confusion with datatable sorting/finding Pin
Wjousts21-Sep-05 9:52
Wjousts21-Sep-05 9:52 
GeneralRe: confusion with datatable sorting/finding Pin
melanieab21-Sep-05 10:23
melanieab21-Sep-05 10:23 
QuestionHelp! C#/ASP.NET/Dreamweaver Pin
Cpen21-Sep-05 7:29
Cpen21-Sep-05 7:29 
QuestionChange Font for DataGrid Column Pin
zaboboa21-Sep-05 6:27
zaboboa21-Sep-05 6:27 
AnswerRe: Change Font for DataGrid Column Pin
deep721-Sep-05 19:30
deep721-Sep-05 19:30 
GeneralRe: Change Font for DataGrid Column Pin
zaboboa22-Sep-05 2:56
zaboboa22-Sep-05 2:56 
QuestionUpdate MySQL databases Pin
Ming Luo21-Sep-05 6:19
Ming Luo21-Sep-05 6:19 
Hello everybody!
I created a database in MySQL, and successfully made connection from the C# application to MySQL. When I try to insert new record and update the database, it gave me an error message which is said
"ERROR [07006] Restricted data type attribute violation(SQL_C_NUMERIC)".
My code is
DataRow new_machine = main_form.db.Ds.Tables["machine"].NewRow();
new_machine["StockNo"] = stockno_txt.Text;
// Add a new machine record into the dataset
main_form.db.Ds.Tables["machine"].Rows.Add(new_machine);
// write it back to mysql database;
main_form.db.UpdateDatabase("machine");
The UpdateDatabase function is
public bool UpdateDatabase(string table)
{
System.Data.Odbc.OdbcDataAdapter adapter =
new OdbcDataAdapter("select * from "+table, _connection);
new OdbcCommandBuilder(adapter);

try
{
adapter.Update(_ds, table);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
return false;
}
_ds.Tables[table].AcceptChanges();
return true;
}

In the database, the field StockNo is declared as varchar(8) primary key.
Could somebody solve this problem for me please???
Thanks in advance!!!


Asura
QuestionEditable tab page title Pin
MotherNuBBeR21-Sep-05 6:06
MotherNuBBeR21-Sep-05 6:06 
AnswerRe: Editable tab page title Pin
Dario Solera21-Sep-05 6:25
Dario Solera21-Sep-05 6:25 
QuestionHow to read text from the interface of another application? Pin
AndyH7021-Sep-05 5:38
AndyH7021-Sep-05 5:38 
QuestionMultiline Crystal Reports (Wrap Word) Pin
| Muhammad Waqas Butt |21-Sep-05 5:17
professional| Muhammad Waqas Butt |21-Sep-05 5:17 
Questioninstalled applications Pin
Mridang Agarwalla21-Sep-05 4:18
Mridang Agarwalla21-Sep-05 4:18 
AnswerRe: installed applications Pin
David Stone21-Sep-05 10:38
sitebuilderDavid Stone21-Sep-05 10:38 
QuestionActive X Control In C# Web App Pin
Adrian Metcalfe21-Sep-05 4:16
Adrian Metcalfe21-Sep-05 4:16 
AnswerRe: Active X Control In C# Web App Pin
Judah Gabriel Himango21-Sep-05 4:41
sponsorJudah Gabriel Himango21-Sep-05 4:41 
GeneralRe: Active X Control In C# Web App Pin
Adrian Metcalfe21-Sep-05 5:11
Adrian Metcalfe21-Sep-05 5:11 
GeneralRe: Active X Control In C# Web App Pin
Judah Gabriel Himango21-Sep-05 5:47
sponsorJudah Gabriel Himango21-Sep-05 5:47 
GeneralRe: Active X Control In C# Web App Pin
Adrian Metcalfe21-Sep-05 21:22
Adrian Metcalfe21-Sep-05 21:22 
GeneralRe: Active X Control In C# Web App Pin
Judah Gabriel Himango22-Sep-05 4:04
sponsorJudah Gabriel Himango22-Sep-05 4:04 
GeneralRe: Active X Control In C# Web App Pin
Adrian Metcalfe22-Sep-05 4:35
Adrian Metcalfe22-Sep-05 4:35 
GeneralRe: Active X Control In C# Web App Pin
Judah Gabriel Himango22-Sep-05 5:49
sponsorJudah Gabriel Himango22-Sep-05 5:49 
GeneralRe: Active X Control In C# Web App Pin
Adrian Metcalfe22-Sep-05 21:42
Adrian Metcalfe22-Sep-05 21:42 
GeneralRe: Active X Control In C# Web App Pin
Judah Gabriel Himango23-Sep-05 4:30
sponsorJudah Gabriel Himango23-Sep-05 4:30 
QuestionIncluding a C struct in a C# application Pin
Cabbi21-Sep-05 4:00
Cabbi21-Sep-05 4:00 

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.