473,625 Members | 2,687 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Strange error - help needed

I am getting the following error:

Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.InvalidC astException: Specified cast is not
valid.
Line 60: Dim myCommand As New MySqlCommand(my InsertQuery)
Line 61: myCommand.Conne ction = myConnection
Line 62: myConnection.Op en()
Line 63: myCommand.Execu teNonQuery()
Line 64: myCommand.Conne ction.Close()
from this code:

Dim myConnectionStr ing As String
="SERVER=localh ost;DATABASE=ev aluation;UID=<u sername>;PASSWO RD=<password>;"

Dim myConnection As New MySqlConnection (myConnectionSt ring)
Dim myInsertQuery As String = "insert into tbl_ssa (ipAddress) values
('127.188.01.01 ')"
Dim myCommand As New MySqlCommand(my InsertQuery)
myCommand.Conne ction = myConnection
myConnection.Op en()
myCommand.Execu teNonQuery()
myCommand.Conne ction.Close()

I have no idea why this is happening. The database and table exist, I
can connect with other projects.

Any help in sorting this out would be greatly appreciated.

Apr 27 '06 #1
4 1013
What exact line is the error happening?

Jeff
"^MisterJin go^" <mi*********@gm ail.com> wrote in message
news:11******** **************@ e56g2000cwe.goo glegroups.com.. .
I am getting the following error:

Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.InvalidC astException: Specified cast is not
valid.
Line 60: Dim myCommand As New MySqlCommand(my InsertQuery)
Line 61: myCommand.Conne ction = myConnection
Line 62: myConnection.Op en()
Line 63: myCommand.Execu teNonQuery()
Line 64: myCommand.Conne ction.Close()
from this code:

Dim myConnectionStr ing As String
="SERVER=localh ost;DATABASE=ev aluation;UID=<u sername>;PASSWO RD=<password>;"

Dim myConnection As New MySqlConnection (myConnectionSt ring)
Dim myInsertQuery As String = "insert into tbl_ssa (ipAddress) values
('127.188.01.01 ')"
Dim myCommand As New MySqlCommand(my InsertQuery)
myCommand.Conne ction = myConnection
myConnection.Op en()
myCommand.Execu teNonQuery()
myCommand.Conne ction.Close()

I have no idea why this is happening. The database and table exist, I
can connect with other projects.

Any help in sorting this out would be greatly appreciated.

Apr 27 '06 #2
Jeff Dillon wrote:
What exact line is the error happening?

Hi Jeff,

It's happening on this line:

myConnection.Op en()

Apr 27 '06 #3
Not sure about your connection string. Usually it's (local) and not
localhost.

http://www.connectionstrings.com

"^MisterJin go^" <mi*********@gm ail.com> wrote in message
news:11******** *************@i 40g2000cwc.goog legroups.com...
Jeff Dillon wrote:
What exact line is the error happening?

Hi Jeff,

It's happening on this line:

myConnection.Op en()

Apr 27 '06 #4
Hi Jeff,

When i try that I get the following exception thrown:

Exception Details: System.Net.Sock ets.SocketExcep tion: No such host is
known

Apr 28 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1783
by: WindAndWaves | last post by:
Hi Gurus The page below has a strange error. It seems to be working very well, just when you enter 8 or 9 for day, month or year then you get an error. I really have no idea where that is coming from. Can you help? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD>
3
1756
by: Alfonso Morra | last post by:
I have some code that I am porting over from C. It is full of static functions and global variables. I have got around this by wrapping most of the code in a singleton object. However, I am findng that in my method definitions, I am having to fully scope the names of any other functions I am calling. I do not understand this. The clas declaration code look some thing like this: class A: public Singleton<A> { public:
3
3165
by: Don McNamara | last post by:
Hi, I've hit quite a strange problem with XmlSerializer on my W2K3 server. When I serialize/deserialize using an exe on my local computer (XP), everything works fine. When I put the code out on the server (W2K3) it throws an exception. It only seems to happen when serializing/deserializing _arrays_ of a type. If I just serialize/deserialize one instance, it works fine. The exception I get is: (sorry for the word wrapping.)...
2
3682
by: Rhino | last post by:
I am trying to write a trigger/UDF combination that closely follows the example given in the following DeveloperWorks article: http://www-106.ibm.com/developerworks/db2/library/techarticle/0205bhogal/0205bhogal.html Unfortunately, when my UDF starts to compose the email, something goes wrong and DB2 begins writing to db2diag.log - and writing, and writing, and writing. Millions of lines get written if I don't kill the processes. I've...
25
3716
by: Neil Ginsberg | last post by:
I have a strange situation with my Access 2000 database. I have code in the database which has worked fine for years, and now all of a sudden doesn't work fine on one or two of my client's machines. The code opens MS Word through Automation and then opens a particular Word doc. It's still working fine on most machines; but on one or two of them, the user is getting an Automation Error. The code used is as follows: Dim objWord As...
1
1777
by: Nadav | last post by:
I have a strange problem with inherited controls: I have created two user controls called UserLoginA & UserLoginB. One of the properties of these controls is of type UserGroup ( a class I defined in another assembly). Then I show that UserLoginA & UserLoginB have a lot of common code, so I decided to inherit UserLoginB from UserLoginA. So I Created a new user control UserControlC that inherits from UserLoginA, added the code needed to...
17
5192
by: jensen bredal | last post by:
Hello, i'm struggling with a somehow badly understood session scenario. I provide acces to my pages based on form authentication using Session cookies. Som of my pages are supposed to be running continuously and refreshing once an hour. I there set timeout= 61 in <sessionState section and on my page it says <meta http-equiv="refresh" content="3600">. I also set timeout=120 in the <forms section of web.config to make sure
4
7343
by: Praveen_db2 | last post by:
Hi All I am getting strange errors in my db2diag.log can any one tell me what these errors mean?? Following is the code from my db2diag.log ********************************************************************************************* 2006-02-23-17.53.12.253000 Instance:DB2 Node:000 PID:1600(db2syscs.exe) TID:440 Appid:AC10E010.J70A.00E883122250 base sys utilities sqleagnt_sigsegvh Probe:1 Database:DEVM_DB Error in agent...
6
2065
by: Hannibal111111 | last post by:
I am getting a strange situation with a .NET 1.1 web application that we have deployed. I have made an update to a code behind page in 1 file, and then made an update to another code behind page. After that I rebuilt everything. This is all on my dev server. Now I move the 1 code behind page and the updated dll to the live server. But I did not move the other code behind page to the live server. Now somehow I am getting an error on...
9
1387
by: Larry | last post by:
I was testing the buffer size of system call, read(), and found a strange error on Ubuntu 7.10 server. The code is attached. If the BUFFSIZE is set to from 128 to 255, the code will produce an error as read error: Success If the if statement (and the perror) is removed, the error disappears. I have tried the same program on Sun Solaris 5.10 and got the same results.
0
8182
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,...
0
8688
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8635
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8352
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
8494
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4085
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2614
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
1
1800
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1496
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.