Cannot insert data with Datatable

Cannot insert data with Datatable

Postby aspirevishal » Mon 17 Dec 2007 14:18

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
aspirevishal
 
Posts: 30
Joined: Fri 31 Aug 2007 03:30
Location: India

Postby Alexey.mdr » Mon 17 Dec 2007 14:56

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.
Alexey.mdr
 
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Test Project send

Postby aspirevishal » Tue 18 Dec 2007 11:50

a test project has been send to you on the email mentioned in readme.txt

please do the need full at the earliest
aspirevishal
 
Posts: 30
Joined: Fri 31 Aug 2007 03:30
Location: India

Just checing the status

Postby aspirevishal » Wed 19 Dec 2007 12:39

Just hoping I get a resolution before holidays start.
aspirevishal
 
Posts: 30
Joined: Fri 31 Aug 2007 03:30
Location: India

Postby Alexey.mdr » Thu 20 Dec 2007 15:48

I have sent you a reply by e-mail
Alexey.mdr
 
Posts: 729
Joined: Thu 13 Dec 2007 10:24


Return to dotConnect for PostgreSQL