G
Guest
I'm quite new to using .net data access components and having problems when
trying to insert a new record to an MS SQL database single table.
First I tried to use a tableadapter generated by VS2005, like this :
messagesDataSetTableAdapter.Insert(paramaters);
This call does not create a new row neither in the DataSet nor in the
database. The database table remains empty, what I especially do not
understand, because msdn articles say that this member of the table adapter
directly interacts with the database not the DataSet. Anyway, I gave up.
For second, following some other msdn articles I tried this :
messagesDataSet.syslogentryRow newRow =
messagesDataSet.syslogentry.NewsyslogentryRow();
newRow.RawEntry = BytesToString(buffer);
newRow.TimeStamp = DateTime.Now;
newRow.Sender = senderEP.Address.ToString();
messagesDataSet.syslogentry.Rows.Add(newRow);
messagesDataSet.AcceptChanges();
This looks better for at least in the way that the inserted rows appear in
the bounded DataGridView, however tha database table still remains empty ?!
What am I missing to commit changes to the database ?
Thanks,
Laszlo
--
-----------------------------
Laszlo, Frank
Technotrade Informatics, Inc.
IT Director
MCSE, CCNA, TCE
-----------------------------
trying to insert a new record to an MS SQL database single table.
First I tried to use a tableadapter generated by VS2005, like this :
messagesDataSetTableAdapter.Insert(paramaters);
This call does not create a new row neither in the DataSet nor in the
database. The database table remains empty, what I especially do not
understand, because msdn articles say that this member of the table adapter
directly interacts with the database not the DataSet. Anyway, I gave up.
For second, following some other msdn articles I tried this :
messagesDataSet.syslogentryRow newRow =
messagesDataSet.syslogentry.NewsyslogentryRow();
newRow.RawEntry = BytesToString(buffer);
newRow.TimeStamp = DateTime.Now;
newRow.Sender = senderEP.Address.ToString();
messagesDataSet.syslogentry.Rows.Add(newRow);
messagesDataSet.AcceptChanges();
This looks better for at least in the way that the inserted rows appear in
the bounded DataGridView, however tha database table still remains empty ?!
What am I missing to commit changes to the database ?
Thanks,
Laszlo
--
-----------------------------
Laszlo, Frank
Technotrade Informatics, Inc.
IT Director
MCSE, CCNA, TCE
-----------------------------