|
.netman wrote: So I'm wondering do I need to convert the textbox value to int before I enter?
actually to a short, as thats the C# equivalent to SmallInt.
short.Parse or, btter still, short.TryParse
|
|
|
|
|
hi
thanks for the answer, however i tried the following and it didnt work:
cmdsqlcommandupdate.Parameters.Add(new SqlParameter("@Height", SqlDbType.SmallInt));
cmdsqlcommandupdate.Parameters["@Height"].Value = short.Parse(tbheight.Text)
it showed the error
'short' does not contain a definition for 'cmdsqlcommandupdate'
why would this be?
thanks so far
|
|
|
|
|
OK ignore that post i used this
short shorttest = short.Parse(tbheight.Text);
cmdsqlcommandupdate.Parameters.Add(new SqlParameter("@Height", SqlDbType.SmallInt));
cmdsqlcommandupdate.Parameters["@Height"].Value = shorttest;
but it is still not updating the field
The textbox where the value comes from is in a panel, the update button is in a different area , would this make a difference?
cheers
|
|
|
|
|
No, not in the slightest. Have you taken the params passed into the debugger and run them through the proc in your DB to see if the issue is your database code ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Because you don't have a semicolon at the end ?
You should use TryParse, or this code will blow up if the text is not a short.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
<blockquote class="FQ"><div class="FQA">Christian Graus wrote:</div>Because you don't have a semicolon at the end ?</blockquote>
I cant see where I am missing one from the statement above
I tried:
short shorttest = short.TryParse(tbheight.Text);
but it gives the error:
No overload for method 'TryParse' takes '1' arguments
Thanks christian
|
|
|
|
|
I guess if you paid attention to the intellisense, or read the docs...
short shorttest;
if ( short.TryParse(tbheight.Text, out shorttest))
{
// This means the parse was successful.
}
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
.netman wrote: No overload for method 'TryParse' takes '1' arguments
have you checked out the documentation for short.TryParse??
If you did you'll see it returns a boolean and has a second parameter.
short shorttest = 0;<br />
if(short.TryParse(tbHeight.Text, out shorttest)<br />
{<br />
}
|
|
|
|
|
OK
I think the problem runs deeper, I have just tried updating another field and it hasnt worked either, the field is a nvarchar
If i hardcode values in it works, but when I get them from textbox it doesnt
The texboxes are in panels but the update button is outside the panel, would this affect it?
thanks!
|
|
|
|
|
.netman wrote: The texboxes are in panels but the update button is outside the panel, would this affect it?
No, it shouldn't. When you set breakpoints, are the right values being found ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Yeah the right values are found
The weird thing is, i am using one of the textboxes to find the correct field in the database and update that row.
It finds that textbox ok, but when I try and use any other textbox it just wont update
If I hardcode it does
Shall I post some code
I tried the
short shorttest;
if ( short.TryParse(tbheight.Text, out shorttest))
{
// This means the parse was successful.
}
but this didnt work either
|
|
|
|
|
OK, I've found the problem
Im so stupid!
Basically I had textfields which were displaying data from a database, this data was selected on pageload and applied to the textboxes
I moved this code to page init and it worked
how annoying
thanks for the help thouhg guys
|
|
|
|
|
can i write this code?
window.open('C:/webpart/a.htm')
or i should write a url instead of 'c:/webpart/a.htm'
|
|
|
|
|
window.open should use a URL, for reasons that I hope are obvious. Being javascript, it runs on the client, so cannot see your servers file system.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi all,
does http protocol and its authentication remains same?? When it comes to mobile web form(in mobile browsers) and desktop webform(in normal IE/firefox...)
CAN U Give Me Various mobile web Browsers????
thanks,
Prashanth
prashanth,
s/w Engineer
|
|
|
|
|
Yes, if HTTP was not the same, it would not work.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks, But I was helpless, I mean I surfed in google too, but couldn't found my answer....
I want few test cases on Http Authentication for mobile browser..
Thanks,
|
|
|
|
|
Hello,
does anyone know of a asp.net control which has a ASP:SELECT with, when a list-item "Other" is selected, allows for a textbox where the user can enter an alternative answer besides the ones listed in the select?
Thansk a lot!
Morten
|
|
|
|
|
sounds easy to write.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hello friends
I am having a form with few text-boxes... and a button ..i am displaying ajax calender on button click ..problem is calender is appearing behind the other textboxes....
please suggest how to solve it
Thank You
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
Use a different calendar control. I'm not sure of the exact reason, but it has nothing to do with AJAX, some popups just appear behind some controls.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thank you for the suggestion
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
hello,
How do you tell your calendar to become visible? do you use PopupExteders or PopupControl from AjaxToolkit? if you don't so do it!
if you had used them and the problem is still there so I'm not sure but check your page layer if it is absolute.
|
|
|
|
|
we are having a calendar control in ajax tool kit ...so i am using that one
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|