473,395 Members | 1,783 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

writing data to the database vb .net 2005 2.0- Important!!!

hello,

I am using the code below to add to the database but for some reason i get an error message "provider". i donot know what am doing wrong. It is a whole table although at the moment am trying out with one field. i dont know if i should still have an sqldatasource on my web page as i am inserting into the database and not reading from it. please advise.......

Dim conn As String = System.Configuration.ConfigurationManager.Connecti onStrings("ConnectionString7").ConnectionString
Dim myConnection As System.Data.SqlClient.SqlConnection = New System.Data.SqlClient.SqlConnection(conn)
Dim MySQL As String = "INSERT INTO researcher (R_Surname) VALUES ('" + (TextBox9.Text) + " ')"
Dim cmd As System.Data.SqlClient.SqlCommand = New System.Data.SqlClient.SqlCommand(MySQL, myConnection)
cmd.CommandType = System.Data.CommandType.Text
cmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("R_Surname", TextBox9.Text))
myConnection.Open()
cmd.ExecuteNonQuery()
myConnection.Close()
Apr 2 '07 #1
0 1247

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jake_adl | last post by:
Is there any way to create a Microsoft.Practices.EnterpriseLibrary.Data.Database object without reading from a configuration file? I am writing a utility that manages databases in SQL Server....
6
by: Sparky Arbuckle | last post by:
I'm trying to add customers to the database with the following Add_Customer sub routine. The problem is that it is not writing the information to the database. Any suggestions as to how I can fix...
12
by: Chris Springer | last post by:
I'd like to get some feedback on the issue of storing data out to disk and where to store it. I've never been in a production environment in programming so you'll have to bear with me... My...
1
by: Julian32 | last post by:
Hello, I'm trying to keep track of purchases made from my website by having Paypal redirect users to a page on my site after purchase, and writing the information received to an Access Database....
2
by: banerr2 | last post by:
I'm a beginner in C++. I'm in the process of writing an 'Automated Library Management System' using C++ on a Windows machine. I'm stuck in the midst of reading/writing data from a .csv file that...
1
by: vijaymohan | last post by:
Hi ..I am very new to perl..can some one help me with this script pls.. I am Querying database and writing data to excel.. Here is my script: #!/usr/bin/perl -w use strict; use DBI;
0
hunnicutt
by: hunnicutt | last post by:
I want to be able to click on the save icon and have the data on the form save to the original database. Right now I seem to have a disconnected dataset I have tried to change everything from read...
4
hunnicutt
by: hunnicutt | last post by:
I want to be able to click on the save icon and have the data on the form save to the original database. Right now I seem to have a disconnected dataset I have tried to change everything from read...
2
by: plonk | last post by:
Hi I am trying to write to a sql database, but the Update method is not writing the data to the database. I can view the data coming into the dataset grid ok and no errors are generated. I'm...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.