473,407 Members | 2,629 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,407 software developers and data experts.

insertdata in sqlserver2000

How to insert textbox data in sqlserver2000 in ado.net
Sep 13 '07 #1
1 937
shweta123
692 Expert 512MB
Hi,

Here is the example for inserting the data using Ado.net

Public sub InsertData()

Dim con as new oledb.Connection
Dim strcon as String
Dim com as new Oledb.Command


''connectionstring for connection to Pubs database

strcon = "Provider=SQLOLEDB.1;Persist Security Info=True;UserID=sa;password=;Initial Catalog=Pubs;Data Source=."

con.ConnectionString = strcon

'''Open the connection

con.open


''''''''Insert into database

''Take the values from textboxes

Dim ID as int
Dim strName as string
ID = Textbox1.text
strName = Textbox2.text


Sql = "Insert into tablename(ID,Name) values(" & ID & ",'" & strName & "')"

com.Connection = con
com.CommandType = Text
com.CommandText = Sql
com.ExecuteNonQuery()

con.close

End Sub


How to insert textbox data in sqlserver2000 in ado.net
Sep 13 '07 #2

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

Similar topics

0
by: Michael Peters | last post by:
(sorry for crossposting, I usually don't but I need a solution quickly) is there a simple way to remotely and programmatically (using a ColdFusion application that can access the database) making...
2
by: red_valsen | last post by:
I have a default installation of SQLServer2000 on a host running Win2003. I want to install SQLServer2005 on the same machine, but preserve the original SQLServer2000 installation. How do I do...
0
by: thegoogs | last post by:
Hi, I have a question about users, logins and permissions in SQLServer2000... I have to list every user in a SQLServer, extract which database it can access and which permissions it has for every...
1
by: Marisol | last post by:
After installing sp1 on my Windows 2003 Server I was able to install SQLServer2000, but, during installation I couldn't set up collation options for SQLServer. I heve seen many screenshots where...
1
by: aling | last post by:
Damn! SQLServer2000 can't add a NOT NULL COLUMN even in one empty existing table! That is, A is the existing table and it is emtpy, I want to add one NOT NULL COLUMN (col_new) to A using following...
1
by: ShivBahadur | last post by:
Hi All, how to remove "tempdb is full error in sqlserver2000"
1
by: ShivBahadur | last post by:
Hi All, how to remove "tempdb is full error in sqlserver2000"
2
by: shanthan | last post by:
Hi I have to get datas from sqlserver to Xml and using javascript i have to show in Onmouseover event. I am using sqlserver2000 and C#.net. can u help me? Thanks
1
by: damodarraoaadepu | last post by:
How to retrive images from database (sqlserver2000) in Asp.net?
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: 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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.