|
Replace single quote with double single quote.
string s="insert into vehicletype VALUES('"+TextBox1.Text.Replace("'","''")+"')";
I suggest you to read about SQL Injections[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
hi! blue_boy
I am very thankful to you. Your Answer is absolutely solved my problem.
And I welcome your suggestion.
bye.
|
|
|
|
|
No problem,you are welcome.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Hai All,
Can anyone tell me the encryption algorithm which will return only numbers? I need to encrypt salary.In table salary feild is integer.So i dont want to change the data type of that feild. So i request to give me an algorithm which return integer.
Thanks in advance.
With regards Lijo
|
|
|
|
|
If you're storing it as encrypted then the field doesn't have be an int datatype. Are you decrypting it on the fly? How many records? Consider whether you should be encrypting the salary or the earners identity.
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson Because programming is an art, not a science. Marc Clifton I gave up when I couldn't spell "egg". Justine Allen
|
|
|
|
|
You could use a block mode cipher with a block size the same size as your integer however, without multiple blocks there can't be chaining so it reverts to a trivial to break encryption.
Since salary data is confidential but not mission critical an XOR approach is a good one. You can also use a One Time Pad method.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
Dear All.
I am working on ASP.net 2.0 and using Master Page in which I used one user control and using a text box and button control for searching on the top.
The logo.ascx files which used in Master page is as follows:
<table width="100%" border="1">
<tr><td>
<asp:Image ID="logoimage" runat="server" ImageUrl="~/images/samnlogo3.jpg" AlternateText="SAMN Logo" BorderWidth="0" />
<!--<img src="images/samnlogo3.jpg" alt="SAMN logo"/>--></td>
<td valign="baseline">
<div id="searchdiv" name="SearchDiv">
<asp:textbox id="SomeText" runat="server"></asp:textbox>
<asp:button id="Submit" runat="server" text="Submit Form"></asp:button>
Now I want to take the text in the text box to another aspx page please tell me a better suggestion. <%@ previous page> does not works in User Controls. Also I am confused with <form > tag how to use it in the Master there is a <form> tag which is mandatory.
Then I want to fetch the data of textbox to use as search criteria in my SQL Query.
Please help me I have tries all possible ways I can do. But I did not got any proper solution.
I need it urgently.
Thanks in Advance.
|
|
|
|
|
You could use querystring or Sessions to do that I think.
The answers posted by me are suggestions only and cannot be used in anyway against me.
|
|
|
|
|
You could create a property on your master page to return the text of the text box and then you can reference this using MyMaster. (or something like that - can't remember off the top of my head).
|
|
|
|
|
Please Reply with proper example because I have these things already, creating property on master page, creating simple form without runat tag and previous page property and postback url things but I couldn't make it working so I need an exact working model.
Thanks
|
|
|
|
|
Hi all,
I have one problem , i have one website, after login my site it redirect to gmail home page , for this i need to authenticate my users to google , how to do?
if anybody knows plz give some idea?
Thanks & Regards
Sams
sams
|
|
|
|
|
You cant do that I dont think.
You cant control Google's login page. The user will just have to log into their own Google account.
The answers posted by me are suggestions only and cannot be used in anyway against me.
|
|
|
|
|
you need to use the web service of Google but Google not providing any web service to login from other website.....
You Contact Customer Care of Google.
Regards,
Shaik Haneef
|
|
|
|
|
Hai all,
i have a wep page suppose webform1.aspx.
Here i have written some code within try catch block.
i have a messagebox(javascript) and i want to show ,if any error occurs in my page
try
catch ex as exception
msgbox(ex.message)
exit sub
end try
but my msgbox is not showing my error,instead it is displaying nothing.
but if i do with response.write in catch block,it is displaying the error.
If i want to show only in messagebox,
how can i display,
if any body have idea,plz let me know.
thanks in advance
kissy
|
|
|
|
|
msgbox work only in Local Not in Server
use RegisterClint Script Block insted of msgbox
Example
catch ex as exception
ClientScript.RegisterClientScriptBlock(me.GetType(),"key1","alert('" + ex.message + "')"
exit sub
end try
|
|
|
|
|
thanks for your response.
clientscript is giving some error,means am i need to import some namespace like that.
kissy
|
|
|
|
|
no need of import anything, i think Quotes may be mismatch please check it, then automatically solved your problem
Cheers...
|
|
|
|
|
try this i think this one work definitely
ClientScript.RegisterClientScriptBlock(Me.GetType(), "key1", "" & ex.message & "")
|
|
|
|
|
Hi,
I am getting request timeout error whenever I try to load my aspx page having the following code.
Note: I am getting this error only when I set debug="false" in web.config file. The size of the XML Doc which I am rendering to the control(XMLResult) is 10MB.
strxmlString = sbrwriter.ToString().Replace("xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"","");
strxmlString = strxmlString.Replace("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"","");
strxmlString = strxmlString.Replace("<?xml version=\"1.0\" encoding=\"utf-16\"?>","").Trim();
XmlDocument Doc=new XmlDocument();
Doc.LoadXml(sbrwriter.ToString()) ;
System.Xml.Xsl.XslTransform trans = new
System.Xml.Xsl.XslTransform();
trans.Load(Server.MapPath(@"XSL\AutoIssuanceRules.xsl") );
XmlResult.Document=Doc;
XmlResult.Transform =trans;
Please suggest me a solution which does not require a change in the machine.config's session timeout settings.
Thanks in Advance.
|
|
|
|
|
10 MB mean too heavy to load so that only it showing time out....
|
|
|
|
|
can any one help me in this please
I have a Main.aspx .I would like to include Login.aspx , Links.aspx pages into Main.aspx . How would it be done (without Master Pages ).In ASP we have the tag
which include a file , say in a table cell.
Like wise is it possible in ASP.NET?
thanks in advance
Kovuru Sreedhar
|
|
|
|
|
You can use the IFrame
The Web Developer. Beirout-Lebanon
|
|
|
|
|
Make it a control, an ascx, which you can reuse.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
hi i have a tabcontrol ajax
and a linkbutton
my link button must creat a new tab on my tabcontrol
i have this code
but it has this error
first time that i click on this linkbutton it creates the tab but then when i click it makes an error
code:
Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton1.Click
Dim a As New AjaxControlToolkit.TabPanel()
a.HeaderText = "sfdasdfasd"
a.ID = a.GetHashCode().ToString()
Me.TabContainer1.Tabs.Add(a)
End Sub
error:
[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index]
System.Web.UI.ControlCollection.get_Item(Int32 index) +2107838
AjaxControlToolkit.TabPanelCollection.get_Item(Int32 index) +44
AjaxControlToolkit.TabContainer.LoadClientState(String clientState) +251
AjaxControlToolkit.ScriptControlBase.LoadPostData(String postDataKey, NameValueCollection postCollection) +94
AjaxControlToolkit.TabContainer.LoadPostData(String postDataKey, NameValueCollection postCollection) +60
AjaxControlToolkit.ScriptControlBase.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +36
System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +661
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1194
Nika Asgari
|
|
|
|
|
I am using all the controls in the update panel including the iframe and ajaxToolkit:ModalPopupExtender. On button click i block the whole page using javascript and display ajaxToolkit:ModalPopupExtender.
Everything is doing fine. But the iframe which is in page inside update panel is not getting blocked. Instead it is overlapping the ajaxToolkit:ModalPopupExtender.
Did anybody know the solution.
VanithaVasu
|
|
|
|