473,395 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Catch after NEWROW() is executed

Hi all,

I am starting to learn how to program VB.Net and I found got an problem when
try to insert a new row into the table.

I had create an form to whole all the DataSet, OleDbDataAdaper and connection. Each adapter will only hold one table and one type of transaction e.g. dsADataGrid (table A use for data grid only), dsA (for select, indert, update ...), dsAMaxCC (for select the maximun value in CC column from table A)

I have no idea what's wrong as Exception always Catch the NEWROW statement after execute.

connection established during the main form open

The table AGENCY-CC only got 2 fields "CC" integer and "COMPANY_NAME" string(60)

db = OleDbDataAdaper
ds = dataset

With frmDataModule
Try
.dsAGENCYCC.Clear()
drAddrow = .dsAGENCYCC.Tables("AGENCY-CC").NewRow()
drAddrow("CC") = intCC
drAddrow("COMPANY_NAME") = txtCompanyName.Text
.dsAGENCYCC.Tables("AGENCY-CC").Rows.Add(drAddrow)
.dbAGENCYCC.Update(.dsAGENCYCC, "AGENCY-CC")
Catch ex As Exception
MessageBox.Show("Add Database Record Error. Key = " & txtCompanyName.Text, "Data Add Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End With

Please help!!!
Jul 12 '07 #1
2 985
Problem Solved!!!

Thank you!
Jul 12 '07 #2
Killer42
8,435 Expert 8TB
Ah, too quick for us. :)

Would you care to describe what the solution was? This could be helpful for anyone else who has a similar problem in future.
Jul 12 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Z D | last post by:
Hi, I was wondering what's the point of "finally" is in a try..catch..finally block? Isn't it the same to put the code that would be in the "finally" section right after the try/catch block?...
11
by: Pohihihi | last post by:
I was wondering what is the ill effect of using try catch in the code, both nested and simple big one. e.g. try { \\ whole app code goes here } catch (Exception ee) {}
17
by: Alexander Mueller | last post by:
I have always wondered what finally is actually for. What would be the exact difference between try { somecode1(); } catch(Exception) { somecode2();
3
by: will | last post by:
Hi all. I've got an question about how to catch an exception. In Page_Load, I place a DataGrid, dg1, into edit mode. This will call the method called GenericGridEvent. GenericGridEvent will call...
5
by: Neelam Karne | last post by:
I am using VB.Net with .Net Framework 1.1 Here is my code Try 'Try my statements Catch
18
by: Simon | last post by:
I was of the impression that code placed after a Try...Catch block was only executed if there was no exception thrown. I've got some VB.net code as part of a Windows form that executes even...
7
by: Sean Kirkpatrick | last post by:
I got caught with my pants down the other day when trying to explain Try...Catch...Finally and things didn't work as I had assumed. Perhaps someone can explain to me the purpose of Finally. I've...
32
by: cj | last post by:
Another wish of mine. I wish there was a way in the Try Catch structure to say if there wasn't an error to do something. Like an else statement. Try Catch Else Finally. Also because I...
6
by: foolmelon | last post by:
If a childThread is in the middle of a catch block and handling an exception caught, the main thread calls childThread.Abort(). At that time a ThreadAbortException is thrown in the childThread. ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.