| | |
Asp.net Sql Query
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2007
Posts: 1
Reputation:
Solved Threads: 0
Hi all
I need urgent help to complete my project
I am unable to update my sql database.I have to update the database using textbox value as primary key and the other tools are textbox,dropdownlist and calender which i have used
I am doin project on ASP.NET using vb.net so plzz give me the coding in vb.net
the code i have written is as shown below
please help me out soon
I need urgent help to complete my project
I am unable to update my sql database.I have to update the database using textbox value as primary key and the other tools are textbox,dropdownlist and calender which i have used
I am doin project on ASP.NET using vb.net so plzz give me the coding in vb.net
the code i have written is as shown below
please help me out soon
ASP.NET Syntax (Toggle Plain Text)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click myConnection = New SqlConnection("server =sqlserver.htsdomain.net;uid=sa;pwd=;database=CentralHTS") 'myConnection.Open() 'myCommand = New SqlCommand(UPDATE task SET Numbercardused=@TextBox1.text,Numberfreetv=@Dropdownlist1,Datefrom,Dateto where (PhoneNumber=@TextBox1.Text)) 'Response.Write("Record Updated")
You need to put strings in double quotes. The sql string argument to the SqlCommand constructor needs to be quoted.
don't put @ in front of the webserver control instances (you are confusing them with TSQL parameters)
The dropDownList you need to use the Selectedvalue property
You need to execute the command now it's built:
myCommand = New SqlCommand("UPDATE task SET ... don't put @ in front of the webserver control instances (you are confusing them with TSQL parameters)
myCommand = New SqlCommand("UPDATE task SET Numbercardused=" & TextBox1.text & " ...
The dropDownList you need to use the Selectedvalue property
... Numberfreetv=" & Dropdownlist1.SelectedValue & " ...
You need to execute the command now it's built:
ASP.NET Syntax (Toggle Plain Text)
myCommand.ExecuteNonQuery()
Last edited by hollystyles; Sep 25th, 2007 at 9:12 am.
![]() |
Similar Threads
- Need Freelance ASP.NET, MS SQL, C#, VB.NET Developer (Web Development Job Offers)
- Senior C#.Net Software Engineer - Oxfordshire - ASP. Net / SQL Server (Web Development Job Offers)
- C#/ASP.Net Developer Needed (Web Development Job Offers)
- Image Verification in Asp.net (ASP.NET)
- ASP .NET C# SQL on Visual Studio 2003, help? (ASP)
- Cheap ColdFusion/ASP.net 2/SQL 2005 Shared and Reseller Hosting (Web Hosting Deals)
- C# ASP.NET Positions (Web Development Job Offers)
- ASP.NET Engineer needed (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: Example of Image Upload
- Next Thread: Problem with system.web.extensions
| Thread Tools | Search this Thread |
.net activexcontrol advice ajax alltypeofvideos appliances asp asp.net bc30451 beginner bottomasp.net box browser button c# cac checkbox click commonfunctions control css dataaccesslayer database datagridview datagridviewcheckbox datalist deployment development dgv dialog dropdownlist dynamic dynamically edit embeddingactivexcontrol expose fileuploader fill findcontrol flash form formatdecimal formview gridview gudi iframe iis javascript listbox login microsoft mono mouse mssql multistepregistration news novell numerical opera panelmasterpagebuttoncontrols parent radio redirect registration relationaldatabases reportemail rotatepage save schoolproject search security sessionvariables silverlight smartcard smoobjects software sql-server sqlserver2005 ssl suse textbox tracking treeview unauthorized validatedate validation vb.net video videos virtualdirectory vista visualstudio web webapplications webdevelopemnt webdevelopment webprogramming webservice xsl youareanotmemberofthedebuggerusers






