473,405 Members | 2,445 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,405 software developers and data experts.

Simple if-then error in onClick

I'm getting the following error when running and if-then upon submitting a
dropdownlist value. HELP?!

Exception Details: System.FormatException: Input string was not in a correct
format.

Sub RunReport_OnClick(sender As Object, e As System.EventArgs)

If ddlCommunities.SelectedItem.Value <> 0 Then
_sqlStmt = _sqlStmt & " AND tblSurvey1.clnGUID =
'"+ddlCommunities.SelectedItem.Value+"'"
End if

BindData()
End Sub

--
_____
DC G
Nov 18 '05 #1
2 967
620
I think there's a bit of a mix-up in your string concatenation syntax
between SQL and VB. See if this example works:

If ddlCommunities.SelectedItem.Value <> 0 Then
_sqlStmt &= " AND tblSurvey1.clnGUID = '" &
ddlCommunities.SelectedItem.Value & "'"
End if
"DC Gringo" <dc******@visiontechnology.net> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
I'm getting the following error when running and if-then upon submitting a
dropdownlist value. HELP?!

Exception Details: System.FormatException: Input string was not in a correct format.

Sub RunReport_OnClick(sender As Object, e As System.EventArgs)

If ddlCommunities.SelectedItem.Value <> 0 Then
_sqlStmt = _sqlStmt & " AND tblSurvey1.clnGUID =
'"+ddlCommunities.SelectedItem.Value+"'"
End if

BindData()
End Sub

--
_____
DC G

Nov 18 '05 #2
620, thanks for you assistance...

I am getting the same error, though.
_____
DC G
"620" <62*@200.NET> wrote in message
news:CY********************@speakeasy.net...
I think there's a bit of a mix-up in your string concatenation syntax
between SQL and VB. See if this example works:

If ddlCommunities.SelectedItem.Value <> 0 Then
_sqlStmt &= " AND tblSurvey1.clnGUID = '" &
ddlCommunities.SelectedItem.Value & "'"
End if
"DC Gringo" <dc******@visiontechnology.net> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
I'm getting the following error when running and if-then upon submitting a dropdownlist value. HELP?!

Exception Details: System.FormatException: Input string was not in a

correct
format.

Sub RunReport_OnClick(sender As Object, e As System.EventArgs)

If ddlCommunities.SelectedItem.Value <> 0 Then
_sqlStmt = _sqlStmt & " AND tblSurvey1.clnGUID =
'"+ddlCommunities.SelectedItem.Value+"'"
End if

BindData()
End Sub

--
_____
DC G


Nov 18 '05 #3

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

Similar topics

3
by: Patchwork | last post by:
Hi Everyone, Please take a look at the following (simple and fun) program: //////////////////////////////////////////////////////////////////////////// ///////////// // Monster Munch, example...
8
by: Dan | last post by:
Using XML::Simple in perl is extreemly slow to parse big XML files (can be up to 250M, taking ~1h). How can I increase my performance / reduce my memory usage? Is SAX the way forward?
6
by: Manuel Collado | last post by:
I would like to write simple, yet well structured documents with a really simple XML DTD (or schema). Either Docbook or SDocbook are overkill for this simple case. XHTML is simpler, but...
13
by: Michael B Allen | last post by:
Hi, I've tried to write the *simplest* memory allocator possible. I think it would be useful in many cases such as allocating memory on stack as a poor man's garbage collection perhaps. I was...
6
by: KevinD | last post by:
assumption: I am new to C and old to COBOL I have been reading a lot (self teaching) but something is not sinking in with respect to reading a simple file - one record at a time. Using C, I am...
2
by: Mike D Sutton | last post by:
Please excuse the terribly 'newbie'ness of this question, unfortunately my C# is very rusty.. What I'm trying to do is write a simple interactive drawing application where a few lines can be moved...
14
by: Giancarlo Berenz | last post by:
Hi: Recently i write this code: class Simple { private: int value; public: int GiveMeARandom(void);
2
by: Michael7 | last post by:
Hi everyone, I'm new to CSS of course, and have been trying to learn it. However, when I try to pull off something as simple as positioning of text . . . nothing works in my index page. So in...
1
by: =?ISO-8859-1?Q?Tor_Erik_S=F8nvisen?= | last post by:
Hi, A while ago I asked a question on the list about a simple eval function, capable of eval'ing simple python constructs (tuples, dicts, lists, strings, numbers etc) in a secure manner:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.