Page 1 of 1

Cannot insert data with Datatable

Posted: Mon 17 Dec 2007 14:18
by aspirevishal
Hi ,


I am trying insert data into database as follows
textbox1.text is one and so on the code used is

Code: Select all

 
try
Dim dt As CoreLab.PostgreSql.PgSqlDataTable
            Dim dr As DataRow
            dt = DataSet11.Tables(0)
            dr = dt.NewRow()
            dr("cust_ac_id") = TextBox1.Text.Trim  ' new account no
            dr("cust_ol_ac_id") = TextBox6.Text.Trim  ' old account no
            dr("cust_nm") = TextBox2.Text.Trim & TextBox3.Text.Trim ' name this has to be changed later on with seperate first and last name column
            dr("cust_mnr_dtls") = TextBox5.Text.Trim
            dr("cust_addrs") = TextBox4.Text.Trim
            dt.Rows.Add(dr)
        Catch ex As Exception
            MsgBox("An Error occured please contact administrator" & Chr(13) & " Error Code 003" & Chr(10) & ex.Message, MsgBoxStyle.Critical)
        End Try
The problem is when I execute the above in click event of a button it throws a exception saying Column cust_ac_id does not belong to cust_dtls .

But cust_ac_id is a part of the table.


Note:
dataset11 is filling the datagrid view before being used for entry

Posted: Mon 17 Dec 2007 14:56
by Alexey.mdr
Could you please send me a small test project to reproduce the problem?

It is desirable to use 'test' schema objects, otherwise include the definition of your own database objects.

Try to avoid using third party components.

Test Project send

Posted: Tue 18 Dec 2007 11:50
by aspirevishal
a test project has been send to you on the email mentioned in readme.txt

please do the need full at the earliest

Just checing the status

Posted: Wed 19 Dec 2007 12:39
by aspirevishal
Just hoping I get a resolution before holidays start.

Posted: Thu 20 Dec 2007 15:48
by Alexey.mdr
I have sent you a reply by e-mail