Showing posts with label variable. Show all posts
Showing posts with label variable. Show all posts

Thursday, March 22, 2012

Taking out Quotation marks in text.

Hi

How can I take Quotation marks ( " ' ) out of a variable before I post it to a database.

The database return errors if I dont take it out.

ThanksUse the SqlParameter of OleDbParameter classes, and the database will not 'give errors'.
A single quote must be replaced by 2x single quote, when used in a query. This is the cause of the errors.
Check this post...

http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=317174

good luck sir
Thanks that helped a lot
u can use..

dim str as string
str = Replace(the_text, " ' ", "**")

Tuesday, March 13, 2012

td bgcolor based on variable

Hello, I am fairly new at ASP.Net and I am using 2.0. I am populating a table from a SQL query. If the field is blank/null, I would like to color the background yellow in the. How do I test for the variable and make this happen? Thanks for your help. Jim

This should help

Custom Formatting Based Upon Data

http://www.asp.net/learn/dataaccess/tutorial11vb.aspx?tabid=63


Create a databound envent handler and make the corresponding format according to the data you get. Yeah, the above link a great one and should solve your problem. take a deep look at it. thanks