473,806 Members | 2,874 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Catch after NEWROW() is executed

2 New Member
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_NA ME" string(60)

db = OleDbDataAdaper
ds = dataset

With frmDataModule
Try
.dsAGENCYCC.Cle ar()
drAddrow = .dsAGENCYCC.Tab les("AGENCY-CC").NewRow()
drAddrow("CC") = intCC
drAddrow("COMPA NY_NAME") = txtCompanyName. Text
.dsAGENCYCC.Tab les("AGENCY-CC").Rows.Add(d rAddrow)
.dbAGENCYCC.Upd ate(.dsAGENCYCC , "AGENCY-CC")
Catch ex As Exception
MessageBox.Show ("Add Database Record Error. Key = " & txtCompanyName. Text, "Data Add Error", MessageBoxButto ns.OK, MessageBoxIcon. Error)
End Try
End With

Please help!!!
Jul 12 '07 #1
2 996
ERNESTP
2 New Member
Problem Solved!!!

Thank you!
Jul 12 '07 #2
Killer42
8,435 Recognized Expert Expert
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
2738
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? (ie, forget the finally block and just end the try/catch and put the code after the try/catch block). Or does the "finally" construct add some additional functionality?
11
3494
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
2359
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
1858
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 a mehtod called ExceptionGenerator that will generate a run-time exception. The exception is caught in GenericGridEvent, but it isn't caught in InitializeComponenet (which doens't suprise me). I can't figure out where to catch an error that may...
5
1673
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
2893
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 when an exception is thrown - it behaves as if the code is part of a finally block. Looking through all the documentation and MSDN articles, it seems that none of the examples contain code placed
7
1732
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 looked at several texts that I have and none of them address this specific point. If I call some method that throws an exception in my routine Foo, sub foo call bar <- throws an exception do something else <- never get here
32
6132
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 understand Finally runs whether an error was caught or not, I haven't found a use for finally yet.
6
7451
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. The question is: after the ThreadAbortException is thrown, does the childThread continue run the remaining code in the catch block?
0
9719
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9597
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10372
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9187
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5682
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4329
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3851
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.