•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 456,510 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,681 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 2319 | Replies: 2
![]() |
| |
•
•
Join Date: Sep 2007
Posts: 1
Reputation:
Rep Power: 0
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
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")•
•
Join Date: Feb 2005
Location: Braintree, UK
Posts: 1,166
Reputation:
Rep Power: 7
Solved Threads: 59
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:
myCommand.ExecuteNonQuery()
Last edited by hollystyles : Sep 25th, 2007 at 9:12 am.
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- 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



Hybrid Mode