473,569 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.FormatEx ception: Input string was not in a correct
format.

Sub RunReport_OnCli ck(sender As Object, e As System.EventArg s)

If ddlCommunities. SelectedItem.Va lue <> 0 Then
_sqlStmt = _sqlStmt & " AND tblSurvey1.clnG UID =
'"+ddlCommuniti es.SelectedItem .Value+"'"
End if

BindData()
End Sub

--
_____
DC G
Nov 18 '05 #1
2 973
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.Va lue <> 0 Then
_sqlStmt &= " AND tblSurvey1.clnG UID = '" &
ddlCommunities. SelectedItem.Va lue & "'"
End if
"DC Gringo" <dc******@visio ntechnology.net > wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
I'm getting the following error when running and if-then upon submitting a
dropdownlist value. HELP?!

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

Sub RunReport_OnCli ck(sender As Object, e As System.EventArg s)

If ddlCommunities. SelectedItem.Va lue <> 0 Then
_sqlStmt = _sqlStmt & " AND tblSurvey1.clnG UID =
'"+ddlCommuniti es.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******** ************@sp eakeasy.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.Va lue <> 0 Then
_sqlStmt &= " AND tblSurvey1.clnG UID = '" &
ddlCommunities. SelectedItem.Va lue & "'"
End if
"DC Gringo" <dc******@visio ntechnology.net > wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
I'm getting the following error when running and if-then upon submitting a dropdownlist value. HELP?!

Exception Details: System.FormatEx ception: Input string was not in a

correct
format.

Sub RunReport_OnCli ck(sender As Object, e As System.EventArg s)

If ddlCommunities. SelectedItem.Va lue <> 0 Then
_sqlStmt = _sqlStmt & " AND tblSurvey1.clnG UID =
'"+ddlCommuniti es.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
3669
by: Patchwork | last post by:
Hi Everyone, Please take a look at the following (simple and fun) program: //////////////////////////////////////////////////////////////////////////// ///////////// // Monster Munch, example program #include <list>
8
6487
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
2052
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 unstructured (no nested sections). And is not really very simple. Before trying to setup a stripped-down document format by myself, I would like to know...
13
5713
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 hoping the clc crowd had some ideas for making it even simpler! In-lined below the full program (132 lines). It's a circular singular linked list...
6
3758
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 trying to read a flatfile. In COBOL, my simple file layout and READ statement would look like below. Question: what is the standard, simple...
2
1284
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 around on the form. What I'm trying to do is in the MouseDown() event hit test each line point and when I find one, store a _reference_ to it. The...
14
2966
by: Giancarlo Berenz | last post by:
Hi: Recently i write this code: class Simple { private: int value; public: int GiveMeARandom(void);
2
1421
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 frustration I made a test page. Just a but of words to test only the code I'm looking for. Still nothing! I apologize if this question is a...
1
2210
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: http://groups.google.com/group/comp.lang.python/browse_thread/thread/58a01273441d445f/ also pointed to a simple eval function by Fredrik Lundh:...
0
7615
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...
0
7924
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. ...
1
7677
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...
0
6284
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...
1
5514
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
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...
0
3653
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...
1
2115
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
0
940
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...

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.