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

save data in sql using listview

Expand|Select|Wrap|Line Numbers
  1. Dim lvitem
  2. Dim iCount As Integer
  3. Dim iLoop As Integer
  4. Dim query3 = New SqlCommand
  5. query3.Connection = New SqlConnection("SERVER=localhost;UID=root;DATABASE=test")
  6. iCount = lvLogs.Items.Count()
  7. If Not lvLogs.Items.Count = 0 Then
  8. Do Until iLoop = lvLogs.Items.Count
  9.  
  10. LvItem = lvLogs.Items.Item(iLoop)
  11. With LvItem
  12. query3.CommandText = "insert into wer(CustomerName,SalesGroup,CustomerType,TypeOfIndustry,RM,SeniorRM) values('" & .SubItems(0).Text & "','" & .SubItems(1).Text & "','" & .SubItems(2).Text & "','" & .SubItems(3).Text & "','" & .SubItems(4).Text & "','" & .SubItems(5).Text & "')"
  13. query3.ExecuteNonQuery()
  14. End With
  15.  
  16. iLoop = iLoop + 1
  17. LvItem = Nothing
  18. Loop
  19. End If
  20. MessageBox.Show("Record Saved!")
  21.  
message box show up but data does not save in my database. kindly help me please?
Nov 17 '11 #1
0 1521

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

Similar topics

1
by: Mamatha | last post by:
Hi I was displayed some data in listview,but i want to display that data with some icons.I want like displaying icon on the left side of the data in the listview in VB.NET How to display icons...
2
by: Joe | last post by:
Anyone can suggest the best method of reading XML and adding data to ListView? Here is the xml data structure:: <xml> <site> <url>http://www.yahoo.com</url> <lastupdate></lastupdate>...
0
by: Rob | last post by:
I have a Webservice written in C# that provides data to both a web browser through ASP.net and to a VC++ client. I have been able to retrieve data from SQLServer and passing to my C++ client as...
2
by: vivekshrivastava51 | last post by:
Hi, i m making on web project using asp.net , C#.net in visual studio 2003 using sql server i have to save data using excel or csv file to database by what can i do if any one have...
1
by: mayang | last post by:
ca anyone help me the right coding in saving data from listview in vb6 to mySQL database...thanx in advance..
1
by: TonyJ | last post by:
Hello! I'm using VS2005. I'm looking at ADO.NET and have found some test tutorial solution on microsoft MSDN. The one that I'm looking at now is called Walkthrough: Saving Data to a Database...
11
by: teqkillah | last post by:
guys good day! i have a problem using listview. can you help with the syntax? i have no idea how to code this. after populating the listview i want it to save all data from the collection to the...
0
by: girishpatil | last post by:
how to modify listview subitems data manually.listview is filled with data from datab
0
by: dehneli | last post by:
I need to take data from listview, column by column, how cant I do that?
0
by: Andre Saputra | last post by:
Dear all. I really need help for my code. im using text box to filter data in listview, heres the code reloadlistview1 "select * from sales where TANGGAL between #" & Text1.Text & "#" & _ ...
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: 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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.