VS 2003.net

  • Thread starter Thread starter Mark Martin
  • Start date Start date
M

Mark Martin

Hi All

I am having a couple problems with VS 2003 VB.net especially when deploying
and running my app on Win 2003 small business server. The app is a simple
but intensive windows form application using ado to retrieve data from an
ODBC database and then populate a MS CRM database using web services.

1. The try... catch statement does not appear to work all the time and
generates an unhandled error even though the line of code causing the error
is in the try statement.

2. IsDBNull does not return the correct value causing runtime errors.

Does anyone know if these are bugs or is there something specific I need to
know for this to work.
 
Hi Mark,

Can you show up a bit of code - eg, one of the try...catch blocks and a few
of the isdbnull calls. isdbnull is particularly difficult as it wants not
to be on a line with anything else. But in any event, let us see some code
and hopefully we can help.

Bernie Yaeger
 
Hi

Someone replied requesting some samples of failing code:
The following Try..catch statement does not always work:

Try
NNoteId = myNotes.Create(mybizUser, AddString)
NumNotesCon = NumNotesCon + 1
Catch myE As Exception
Try
If myNotes Is Nothing Then
myNotes = New
Microsoft.CRM.Platform.Proxy.CRMNotesManager
myNotes.Credentials =
System.Net.CredentialCache.DefaultCredentials
myNotes.Url = StrDir & "CRMNotesManager.srf"
End If
If RetryCreateUpdate() = True Then
NNoteId = myNotes.Create(mybizUser, AddString)
NumNotesCon = NumNotesCon + 1

etc...
end try
end try

If the original line of code fails I want to catch the error and check and
retry some connections and then try the create function again. However I get
a connection failed popup error which is possible and the reason I want to
trap any error caused by this line. I am not new to ado, I am new to .net
however I can step thru my code and see that the catch statement is not
working or in some cases it is woking however the error still pops up. This
seems to be mostly a problem on win 2003.

Isdbnull sample

isdbnull(myRS.Fields(5).Value)=True then ......

myRS is an ado recordset connecting to an ODBC database and a single table.
The statement simply does not always return the correct true/false value
based on the field value, regardless of the OS.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top