473,614 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

urgent help needed - input string not in correct format

ZZZ
this code :
try

{

DataSet dsDeurprijs = new DataSet();

SqlDataAdapter sqlDeurprijs = new SqlDataAdapter( "Select
isnull(convert( varchar,promopr ijsKK),'')as promoprijsKK from DEURPRIJZEN
where DEUR_KODE=" + sKode_deur,sqlC onnection3);

sqlDeurprijs.Fi ll(dsDeurprijs) ;

int prijs =
Convert.ToInt32 (dsDeurprijs.Ta bles[0].Rows[0].ItemArray[0].ToString());

MessageBox.Show (prijs.ToString ());

}

catch(Exception ex)

{ MessageBox.Show (ex.Message.ToS tring());}

gives me : input string not in correct format

info :

promoprijsKK field = money

sKode_deur=stri ng


Nov 16 '05 #1
4 3214
MA

"ZZZ" <no@spam.com> wrote in message
news:uT******** *****@TK2MSFTNG P11.phx.gbl...
this code :
try

{

DataSet dsDeurprijs = new DataSet();

SqlDataAdapter sqlDeurprijs = new SqlDataAdapter( "Select
isnull(convert( varchar,promopr ijsKK),'')as promoprijsKK from DEURPRIJZEN
where DEUR_KODE=" + sKode_deur,sqlC onnection3);

sqlDeurprijs.Fi ll(dsDeurprijs) ;

int prijs =
Convert.ToInt32 (dsDeurprijs.Ta bles[0].Rows[0].ItemArray[0].ToString());

MessageBox.Show (prijs.ToString ());

}

catch(Exception ex)

{ MessageBox.Show (ex.Message.ToS tring());}

gives me : input string not in correct format

info :

promoprijsKK field = money

sKode_deur=stri ng


How doés the string looks like and how do you want it to look like?

/Marre
Nov 16 '05 #2
ZZZ
select statement showed in messagebox is OK (tested in sql query analyzer)
dont know why this error is generated

"MA" <ne**@supremeli nk.se> wrote in message
news:2p******** ****@uni-berlin.de...

"ZZZ" <no@spam.com> wrote in message
news:uT******** *****@TK2MSFTNG P11.phx.gbl...
this code :
try

{

DataSet dsDeurprijs = new DataSet();

SqlDataAdapter sqlDeurprijs = new SqlDataAdapter( "Select
isnull(convert( varchar,promopr ijsKK),'')as promoprijsKK from DEURPRIJZEN
where DEUR_KODE=" + sKode_deur,sqlC onnection3);

sqlDeurprijs.Fi ll(dsDeurprijs) ;

int prijs =
Convert.ToInt32 (dsDeurprijs.Ta bles[0].Rows[0].ItemArray[0].ToString());

MessageBox.Show (prijs.ToString ());

}

catch(Exception ex)

{ MessageBox.Show (ex.Message.ToS tring());}

gives me : input string not in correct format

info :

promoprijsKK field = money

sKode_deur=stri ng


How doés the string looks like and how do you want it to look like?

/Marre

Nov 16 '05 #3
I don't understand why you, in your slect, convert the promoprijsKK field to
varchar, and then in Int32 in your code?

try
{
DataSet dsDeurprijs = new DataSet();
SqlDataAdapter sqlDeurprijs = new SqlDataAdapter( "Select promoprijsKK
from DEURPRIJZEN where DEUR_KODE=" + sKode_deur,sqlC onnection3);

sqlDeurprijs.Fi ll(dsDeurprijs) ;

if (dsDeurprijs.Ta bles[0].Rows[0][0]!=System.DbNull .Value)
{
int prijs =(int)dsDeurpri js.Tables[0].Rows[0][0];
MessageBox("pri js="+prijs);
}
else MessageBox("DbN ullValue");
}
catch(System.Ex ception e)
{
MessageBox(e.Me ssage);
}

"ZZZ" <no@spam.com> schrieb im Newsbeitrag
news:uT******** *****@TK2MSFTNG P11.phx.gbl...
this code :
try

{

SqlDataAdapter sqlDeurprijs = new SqlDataAdapter( "Select
isnull(convert( varchar,promopr ijsKK),'')as promoprijsKK from DEURPRIJZEN
where DEUR_KODE=" + sKode_deur,sqlC onnection3);

sqlDeurprijs.Fi ll(dsDeurprijs) ;

int prijs =
Convert.ToInt32 (dsDeurprijs.Ta bles[0].Rows[0].ItemArray[0].ToString());

MessageBox.Show (prijs.ToString ());

}

catch(Exception ex)

{ MessageBox.Show (ex.Message.ToS tring());}

gives me : input string not in correct format

info :

promoprijsKK field = money

sKode_deur=stri ng


Nov 16 '05 #4
ZZZ
thx

this did it

string prijs = dsDeurprijs.Tab les[0].Rows[0].ItemArray[0].ToString();

thx a lot!!!!!!!


"Zürcher See" <aq****@cannabi smail.com> wrote in message
news:Oa******** ******@TK2MSFTN GP10.phx.gbl...
I don't understand why you, in your slect, convert the promoprijsKK field to varchar, and then in Int32 in your code?

try
{
DataSet dsDeurprijs = new DataSet();
SqlDataAdapter sqlDeurprijs = new SqlDataAdapter( "Select promoprijsKK
from DEURPRIJZEN where DEUR_KODE=" + sKode_deur,sqlC onnection3);

sqlDeurprijs.Fi ll(dsDeurprijs) ;

if (dsDeurprijs.Ta bles[0].Rows[0][0]!=System.DbNull .Value)
{
int prijs =(int)dsDeurpri js.Tables[0].Rows[0][0];
MessageBox("pri js="+prijs);
}
else MessageBox("DbN ullValue");
}
catch(System.Ex ception e)
{
MessageBox(e.Me ssage);
}

"ZZZ" <no@spam.com> schrieb im Newsbeitrag
news:uT******** *****@TK2MSFTNG P11.phx.gbl...
this code :
try

{

SqlDataAdapter sqlDeurprijs = new SqlDataAdapter( "Select
isnull(convert( varchar,promopr ijsKK),'')as promoprijsKK from DEURPRIJZEN
where DEUR_KODE=" + sKode_deur,sqlC onnection3);

sqlDeurprijs.Fi ll(dsDeurprijs) ;

int prijs =
Convert.ToInt32 (dsDeurprijs.Ta bles[0].Rows[0].ItemArray[0].ToString());

MessageBox.Show (prijs.ToString ());

}

catch(Exception ex)

{ MessageBox.Show (ex.Message.ToS tring());}

gives me : input string not in correct format

info :

promoprijsKK field = money

sKode_deur=stri ng



Nov 16 '05 #5

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

Similar topics

1
7335
by: WroteForLuck | last post by:
I am trying to write a simple SQL statement which will take a string (startdate) in the format DDMMYYYY and compare it to a date stored in an Oracle database. My SQL is as follows: <% "select * from tblhistory where datechanged = '" & startdate & "'" %>
9
4297
by: Stefan Bauer | last post by:
Hi NG, we've got a very urgent problem... :( We are importing data with the LOAD utility. The input DATE field data is in the format DDMMYYYY (for days) and MMYYYY (for months). The target data format is european DD.MM.YYYY (for days) and 01.MM.YYYY (for months). The input format is not recognizable as a DATE input to a DB2 LOAD for
5
2507
by: blackg | last post by:
Input string not in correct format -------------------------------------------------------------------------------- I am trying to view a picture from a table. I am getting this error Input string not in the correct format. Input string was not in a correct format. 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...
1
1231
by: Jack jensen | last post by:
Hello, I have the code below :(simplified zip code format) try { Convert.ToInt32(tbOShipPostalCode.Text); } catch
1
2169
by: dasilva109 | last post by:
Hi guys I am new to C++ and need urgent help with this part of my code for a uni coursework I have to submit by Thursday //ClientData.h #ifndef CLIENTDATA_H #define CLIENTDATA_H #include <string>
0
2540
by: hudhuhandhu | last post by:
have got an error which says Input string was not in a correct format. as follows.. 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.FormatException: Input string was not in a correct format. Source Error: Line 237: Dim validNow As Integer = 1 Line...
0
11977
by: Anonieko | last post by:
Are there any javascript codes there? Answer: Yes On the PageLoad event call InitialClientControsl as follows /// <summary> /// This will add client-side event handlers for most of the form controls so
0
3160
by: sehguh | last post by:
Hiya Folks, I am Currently using windows xp. Also using Visual Web Developer 2005 and Microsoft Sql server 2005. The main page consists of an aspx page and a master page. The page also consists of a label control(hidden when run in browser). Also an Sql data source control connected to database tables for a photo album. Also label web control ID=UserIdValue. Also a Details View control ID=dvPictureInsert Problem is how to work out...
2
4851
by: perkykoala | last post by:
I apologize in advance for being REALLY detailed/verbose. It's the result of staring/tweaking code for too long. Using VB 2005: I need to design a multiple choice test (unfortunately, I can't use radio buttons). How it works... Pre-1) File consists of the following format: Question 1 Choice 1
0
8197
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
8142
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
8589
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
8287
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
7114
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...
1
6093
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5548
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();...
1
1757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1438
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.