|
hello,
In your there is no any 'm', then why come this type of error?
U must missing something else.
for inserting a string u must quoted the string but for number must not quoted the number.
for example : (sname is varchar2, Roll is number)
String strQuery = "insert into table1 (sname, Roll) values ('" + txtName.text + "'," + txtRoll.text + ")";
I think u r missing any quotation. (single quote ')
ok
Best of luck..
Dipak
|
|
|
|
|
Sorry Friend i forgot to explain the line through which error was being thrown
I'm........
Because of this sentence error is being generated
|
|
|
|
|
I guess you are concatenating the string for your query formation. Don't do that, it's open to SQL Injection. Use parameterized queries which won't throw these kind of exceptions.
|
|
|
|
|
Navaneeth i explain my probs. again.
I've a TextBox in which i enters Name like Jame's and then i click on submit button. But it throws error Incorrect syntax near 's'. Unclosed quotation mark before the character string '
Plz ......
|
|
|
|
|
Quick solution for this issue is by replacing the single qoute with 2 single quotes.
Permanent solution is SQL Injection.
|
|
|
|
|
Before inserting convert the string if it contain single quote (') to double quote (''). It will work. i also had faced this type of problem.
After inserting it stores in the database with single quote.
try it.
and reply..
Best of Luck.
Dipak
|
|
|
|
|
Yes I understand. Problem is in your query forming, You will be forming the query like this now
string query = "Insert into mytable values('" + TextBox1.Text + "')"; Problem here is when a single quotation (') is coming to the text box, your query will become invalid and it throws the exception. Forming queries like this is a bad practice. You need to use parameters to avoid this problem. Look at the example below.
SQLCommand command = new SQLCommand("Insert into mytable values(@FirstValue)",connection);
command.Parameters.Add("@FirstValue",TextBox1.Text); The above method is safe from SQL injection attacks. Don't use easy methods like replacing single quotes to double as a solution.
|
|
|
|
|
Hi All
I am geting problem whilw i using StateServer mode of session state in webconfig.
if I write like this , then its running well...
<sessionstate mode="StateServer" stateconnectionstring="tcpip=127.0.0.1:42424">
stateNetworkTimeout="20" timeout="20" cookieless="false" />
but if I use my system's IP instead of 127.0.0.1 then application is not running.
error comes like this....
"Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection. If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either 'localhost' or '127.0.0.1' as the server name."
I already started ASPStateServer Service.
please help me
thanks
|
|
|
|
|
hey all
i found solution for this..
first sallow remote connetion from registery
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection
set value to 1
then restart ASP.NetStateService ..
it will work now...
|
|
|
|
|
Again, I ask the question because after hours of searching on google and reading through my brand new asp.net books, I have not found any reference to setting up internal email so that members for an asp.net website can message each other WITHIN the website. I am not talking about simply emailing someone to an external email account like google, hotmail, etc.
Does anyone know of any text or specific "tech" word that would reference that?
I have alot of reading to do, but I just don't see anyone online that can send me in the right direction.
Oh and by the way I did find some good articles on passing data through from one page to another so it can be stored in a database. I'll make a more SPECIFIC post when I get the error message.
Thanks guys.
|
|
|
|
|
|
I am using Ajex in asp.net with C#. when I drag and drop the update panel my frmDefault.aspx then remove the intelligence help in source file frmDefault.aspx.
|
|
|
|
|
Gagan Deep Garg wrote: I am using Ajex in asp.net with C#. when I drag and drop the update panel my frmDefault.aspx then remove the intelligence help in source file frmDefault.aspx.
OK... I understood...
|
|
|
|
|
I would first suggest you to frame a complete sentence properly and express youself with clarity without any ambiguities. If you are seriously distraught and struck in a language barrier, since you are India, check out http://www.veta.in/[^].
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
hi all
How to DownLoad a file of any format(like .pdf, .doc etc.) which is stored in database in byte format
thanks in advance...
Amit Metkar
3i-infotech, Mumbai.
|
|
|
|
|
Simple. Get the bytes from the database, and save it as a file with proper file extension.
|
|
|
|
|
but how do i....?
i dont know the file format...
thanx for the reply..
Amit Metkar
3i-infotech, Mumbai.
|
|
|
|
|
Thanks a lot...
Amit Metkar
3i-infotech, Mumbai.
|
|
|
|
|
Software Development
How to Download any file from ASP.NET
You know, some formats (txt, gif etc.) will be shown on the browser rather than downloading when we try. Below is the script which will help you to download any file.
<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->
Response.Clear();
Response.AddHeader(“Content-disposition”, “attachment; filename=”);
Response.WriteFile(“C:\”);
Response.End();
modified on Thursday, February 21, 2008 1:27 PM
|
|
|
|
|
how to show the panel scroll bar when it is loded for the first time
|
|
|
|
|
Set the overflow style to auto or scroll like,
MY_PANEL.Style.Add ("overflow", "auto")
Here MY_PANEL is your panel control's ID.
|
|
|
|
|
i mean that when the form is loaded scroll bar should come to the down instead of showing top by default
|
|
|
|
|
jagadeeshkumar2106 wrote: i mean that when the form is loaded scroll bar should come to the down instead of showing top by default
You can either use named anchor and call it. For Example, if your page name is "Default.aspx", add a named anchor at the end of the name as,
<a name="page_end"></a>
Now while redirecting call "Default.aspx#page_end"
OR
document.getElementById('MY_PANEL').scrollTop = MAXIMUM_SIZE;
|
|
|
|
|
i like to build a website containing maps .in my website anyone click on there location on map and put some details and save it in my site.
e.g-
i have to click my house on map.and type my name , address and some notes in some text boxes then save it . this details have to save in a database with its image coordinate.
how can i do i.please anyone help me step by step.
modified on Wednesday, February 20, 2008 2:04 AM
|
|
|
|
|
hi all
can u plz help me in this..
iam uploading a image using file upload control in asp.net.
but i want to restrict the size of an image ..
can u plz suggest me to restrice the image size.
thank you.
|
|
|
|