C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » Windows »

Inserting checkboxlist items into access database


Posted Date: 30 Oct 2009      Posted By: satheesh      Member Level: Silver     Points: 1   Responses: 2



hi all,
I want to insert the checkboxlist selected items values into msaccess database





Responses

Author: Neetu    30 Oct 2009Member Level: DiamondRating: 3 out of 53 out of 53 out of 5     Points: 3

Try this code.

Dim con As New OleDbConnection
Dim i as integer
Dim cmd as oleDbCommand
i = ListBox1.SelectedItems.Count
For j = 0 To i - 1
Dim s As String
s = ListBox1.SelectedItems(j).ToString
cmd = New OleDbCommand
cmd.Connection = con
cmd.CommandType = CommandType.Text
cmd.CommandText = "insert into tablename (col_name) values ' " & s&" ' "
cmd.ExecuteNonQuery()
cmd = Nothing
Next

regards
Neetu



Author: Lalji    30 Oct 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

try this link

http://social.microsoft.com/Forums/en-US/whatforum/thread/b77ab179-5a69-4e38-91b7-6e85397d3126



Post Reply
You must Sign In to post a response.
Next : Retrive records problem in windows application
Previous : Print doc file without storing
Return to Discussion Forum
Post New Message
Category: Windows

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use