473,320 Members | 1,572 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,320 software developers and data experts.

The third time to ask in here ... Mobile Web form

hello

this is the third time i inquire aboutthe same
thing and none answer me !! .. hope to find help here
i'm using ASP.NET Mobile web application using c#
And i'm facing a problem , i use SQL server Database
I've table inside it a column of type smalldatetime &
i can't change its format , and in the mobile webform
i've a textbox the user enter a string on the format
mm/yyyy ... i need to compare it to the date in the

database And show a certain value to the user depending
on the entered date so i either need to change the date
format in the DB to string or the string that the user
enter to date format
i've tried to use this phrase in the select statement
ex :
string Value_select_text="select value from
MONTHLY_Indicators_Value where convert(varchar(30),month
(indicator_date))+'/'+convert(varchar(30),year
(indicator_date))="+MyDate;

where MyDate is the string that the user entered but it
gave me a strange error
Syntax error converting the varchar value '1/2002' to a
column of data type int.
supposing that the user entered 01/2002 as a date

Best Regards
Amal

Nov 16 '05 #1
3 1480
Hi Amal,

You ask three time in one day. Be patient. Normally you should wait at least
three days before repost the qestion. Don't forget this is a usenet group
and there is also a time difference.

However, if nobody answers your question try to rephrase your question. It
might be not clear enough.

Or it might be not the right group to ask. In your case there is
microsoft.public.dotnet.framework.aspnet.mobile
which might be more helpful.

--

Stoitcho Goutsev (100) [C# MVP]
"Amal Ismail" <fr*********@alex4all.com> wrote in message
news:27*****************************@phx.gbl...
hello

this is the third time i inquire aboutthe same
thing and none answer me !! .. hope to find help here
i'm using ASP.NET Mobile web application using c#
And i'm facing a problem , i use SQL server Database
I've table inside it a column of type smalldatetime &
i can't change its format , and in the mobile webform
i've a textbox the user enter a string on the format
mm/yyyy ... i need to compare it to the date in the

database And show a certain value to the user depending
on the entered date so i either need to change the date
format in the DB to string or the string that the user
enter to date format
i've tried to use this phrase in the select statement
ex :
string Value_select_text="select value from
MONTHLY_Indicators_Value where convert(varchar(30),month
(indicator_date))+'/'+convert(varchar(30),year
(indicator_date))="+MyDate;

where MyDate is the string that the user entered but it
gave me a strange error
Syntax error converting the varchar value '1/2002' to a
column of data type int.
supposing that the user entered 01/2002 as a date

Best Regards
Amal

Nov 16 '05 #2
Hi Amal,

You would be better directing sql server questions to the
sqlserver.programming group. Having said that I think your problem may be
due to not concatenating single quotes around the user entered MyDate value.
If your user can directly enter this value then you should also read about
sql injection attacks.

Cheers

Doug Forster

"Amal Ismail" <fr*********@alex4all.com> wrote in message
news:27*****************************@phx.gbl...
hello

this is the third time i inquire aboutthe same
thing and none answer me !! .. hope to find help here
i'm using ASP.NET Mobile web application using c#
And i'm facing a problem , i use SQL server Database
I've table inside it a column of type smalldatetime &
i can't change its format , and in the mobile webform
i've a textbox the user enter a string on the format
mm/yyyy ... i need to compare it to the date in the

database And show a certain value to the user depending
on the entered date so i either need to change the date
format in the DB to string or the string that the user
enter to date format
i've tried to use this phrase in the select statement
ex :
string Value_select_text="select value from
MONTHLY_Indicators_Value where convert(varchar(30),month
(indicator_date))+'/'+convert(varchar(30),year
(indicator_date))="+MyDate;

where MyDate is the string that the user entered but it
gave me a strange error
Syntax error converting the varchar value '1/2002' to a
column of data type int.
supposing that the user entered 01/2002 as a date

Best Regards
Amal

Nov 16 '05 #3
First of all i have to tell you that i am not good at SQL server.

Coming to your problem, i guess your MyDate value is in double quotes since
its a string.

Supply the MyDate variable as a VALUE (conversion required) within single
quotes instead of sending it as string which has double quotes. Then the
query may execute.

--
Shak
(Houston)
"Amal Ismail" <fr*********@alex4all.com> wrote in message
news:27*****************************@phx.gbl...
hello

this is the third time i inquire aboutthe same
thing and none answer me !! .. hope to find help here
i'm using ASP.NET Mobile web application using c#
And i'm facing a problem , i use SQL server Database
I've table inside it a column of type smalldatetime &
i can't change its format , and in the mobile webform
i've a textbox the user enter a string on the format
mm/yyyy ... i need to compare it to the date in the

database And show a certain value to the user depending
on the entered date so i either need to change the date
format in the DB to string or the string that the user
enter to date format
i've tried to use this phrase in the select statement
ex :
string Value_select_text="select value from
MONTHLY_Indicators_Value where convert(varchar(30),month
(indicator_date))+'/'+convert(varchar(30),year
(indicator_date))="+MyDate;

where MyDate is the string that the user entered but it
gave me a strange error
Syntax error converting the varchar value '1/2002' to a
column of data type int.
supposing that the user entered 01/2002 as a date

Best Regards
Amal

Nov 16 '05 #4

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

Similar topics

0
by: Nick Zdunic | last post by:
Hi, I've been using NUnitASP and found that it reaches it's limits very quickly. It has problems with parsing certain pages and raises errors for these when perhaps it shouldn't. Another...
2
by: John Alesse | last post by:
Hi, I've created a very simple winforms control using the c# wizard in VS .net 2003 that is nothing but a System.Windows.Forms.UserControl. There are no other controls on the form It takes IE 12...
0
by: Aouizerat | last post by:
I have to upload a file from a pocket pc client to a web server. With a non mobile web form, it runs with a HtmlInputFile: .... myFile.PostedFile.SaveAs(...); .... but I can't do this on a...
0
by: Wiktor Zychla | last post by:
Hi there, I've just started to dig into mobile ASP.NET and I'd really wish to clarify few things. I have the experience with ASP.NET. 1) Some tutorials mention something called Microsoft...
1
by: Thomas | last post by:
Hi, I have written a Web Service using Axis C++ Server and a .Net Windows client. I considered every interoperability issue between Axis and .Net( Doc/Literal ...) The .Net Windows client can...
1
by: Hongbo | last post by:
Hi, I have a mobile form: === <body Xmlns:mobile="http://schemas.microsoft.com/Mobile/WebForm"> <mobile:Form id=Form1 runat="server"> <mobile:label runat="server" id="lblT" /> </mobile:Form>...
3
by: shapper | last post by:
Hello, In my Page's VB.NET code I am changing the value of the Profile property NAME. Profile.Name = tbName.Text However, I need to change this property value from a class in my App_Code...
3
by: meo | last post by:
Can I use Visual Studio 2005 (VB.NET) develop WAP site? I cannot see the mobile control or any template like a Visual Studio.NET.
4
by: Piotrekk | last post by:
Hi I am uploading files to my ASP script one by one - from C# application. Each time little upload form is created with backgroundworker in it. When I try to upload THIRD file the worker is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.