£
£ukasz Margielewski
I need to retrieve automunber ID from source access table after inserting
new row...
I tried to do this by this way:
gRUPATableAdapter.Update(dataSetGrafik.GRUPA);
oleDbConnectionForID.Open();
OleDbConnection oleDbConnectionForID = new
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\\Grafik\\GrafikApplication\\Import\\baza
Access\\grafikStruktura.mdb;Persist Security Info=False");
OleDbCommand command = new OleDbCommand("SELECT @@IDENTITY",
oleDbConnectionForID);
IDnewAddedGRUPARow = (int)command.ExecuteScalar(); // why it always give 0
????
oleDbConnectionForID.Close();
But it always gives me nothing... please, help me.. Previously i tried tho
use standard solution my attending RowUpdated event (tutorial from MSDN
website). This approach unfortunately cases that compliter gives my warning:
Warning 5 The event 'GrafikApplication.GRUPATableAdapter.RowUpdated' is
never used c:\Grafik\GrafikApplication\DataSetGrafik2.cs 71 67
I use VS C# Express - and it generics a lot of codes, declaration of events,
like rowchanged, itd.. but I cannnot find where I can correctly attend
RowUpdated event ? Is anyone who can help me ??
new row...
I tried to do this by this way:
gRUPATableAdapter.Update(dataSetGrafik.GRUPA);
oleDbConnectionForID.Open();
OleDbConnection oleDbConnectionForID = new
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\\Grafik\\GrafikApplication\\Import\\baza
Access\\grafikStruktura.mdb;Persist Security Info=False");
OleDbCommand command = new OleDbCommand("SELECT @@IDENTITY",
oleDbConnectionForID);
IDnewAddedGRUPARow = (int)command.ExecuteScalar(); // why it always give 0
????
oleDbConnectionForID.Close();
But it always gives me nothing... please, help me.. Previously i tried tho
use standard solution my attending RowUpdated event (tutorial from MSDN
website). This approach unfortunately cases that compliter gives my warning:
Warning 5 The event 'GrafikApplication.GRUPATableAdapter.RowUpdated' is
never used c:\Grafik\GrafikApplication\DataSetGrafik2.cs 71 67
I use VS C# Express - and it generics a lot of codes, declaration of events,
like rowchanged, itd.. but I cannnot find where I can correctly attend
RowUpdated event ? Is anyone who can help me ??