Fill a table in SQL Server Express

  • Hi,

    I'm trying to fill data in an SQL server table, sofar I wrote the following in C#:

    result contains the data I need to write in to the table Transaction_Header

    private void buttonReportFillTable_Click(object sender, EventArgs e)

    {

    Tools.FillQueue(clientsock, result, Tags.C_TRANSDETAIL);

    Touchpos_SQL_serverDataSet.Transaction_HeaderRow Row = new Touchpos_SQL_serverDataSet.Transaction_HeaderDataTable();

    Here the C# compiler comes back with the following error message:

    Error1Cannot implicitly convert type 'TouchEdit.Touchpos_SQL_serverDataSet.Transaction_HeaderDataTable' to 'TouchEdit.Touchpos_SQL_serverDataSet.Transaction_HeaderRow'C:\Touch application\deploy\Editor\report\report.cs2768TouchEdit

    What am I doing wrong?

    best regards

    Frank

  • Hi,

    You are going to get this error because you are attempting to instantiate an object that is different from the one that you declared.

    You entered:

    Touchpos_SQL_serverDataSet.Transaction_HeaderRow Row = new Touchpos_SQL_serverDataSet.Transaction_HeaderDataTable();

    Perhaps you should have entered:

    Touchpos_SQL_serverDataSet.Transaction_HeaderRow Row = new Touchpos_SQL_serverDataSet.Transaction_HeaderRow();

    regards

    Shaun

     

    Quis custodiet ipsos custodes.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply