Vb.net Help - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › Vb.net Help (1304 Views)
| Vb.net Help by Nobody: 10:30am On Feb 28, 2012 |
Dim con As New OleDb.OleDbConnection Dim dbprovider As String Dim dbsource As String Dim ds As New DataSet Dim da As OleDb.OleDbDataAdapter Dim sql As String dbprovider = "provider=microsoft.Jet.OLEDB.4.0;" dbsource = "Data source=C:\Users\VICTOROUS ARMY\Desktop\NWIND.mdb" con.ConnectionString = dbprovider & dbsource con.Open() Sql = "SELECT * FROM Employees" da = New OleDb.OleDbDataAdapter(Sql, con) da.Fill(ds, "NWIND" ![]() Dim cb As New OleDb.OleDbCommandBuilder(da) Dim dsNewRow As DataRow dsNewRow = ds.Tables("NWIND" .NewRow()dsNewRow.Item("LastName" = TextBox1.TextdsNewRow.Item("FirstName" = TextBox2.Textds.Tables("NWIND" .Rows.Add(dsNewRow)da.Update(ds, "NWIND" ![]() MsgBox("New Record added to the Database" ![]() PLS ANY ONE WHO CAN HELP ME WITH CODE ON HOW TO SEARCH,DELETE,UPDATE,VALIDATE USER LOGIN,NAVIGATE RECORD IN DATABASE BUT THE ABOVE CODE IS THE CODE I USE IN SAVING RECORD ANYONE WHO CAN HELP ME WITH THE CODE TO SEARCH,DELETE,UPDATE,VALIDATE USER LOGIN,NAVIGATE RECORD IN DATABASE WITH THE HELP OF WINDOW FORM IN MICROSOFT VISUAL BASIC 2008 EXPRESS EDITION WITH ACCESS DATABASE AND MICROSOFT SQL SERVER DATABASE |
| Re: Vb.net Help by dellnet: 3:50pm On Feb 28, 2012 |
Depends on what library you are using. Me, I prefer to use ADO so I can use SQL statements. For example to search for a username, I will get the username say from a textbox and put it in sql statement. E.g Dim sqlquery as string = "SELECT * FROM table WHERE username=" & txtuser.text Now I will use the above and search my db. If you are interested in using ADO you should learn the following: 1. How to connect to a database using ADO 2. How to select, update, delete a database using ADO These are pretty easy stuffs. |
| Re: Vb.net Help by Kobojunkie: 5:15am On Feb 29, 2012 |
@Poster dbprovider = "provider=microsoft.Jet.OLEDB.4.0;"Please take a look at this link to learn what a connectionString is and how to format it . . http://www.connectionstrings.com/Articles/Show/what-is-a-connection-string http://www.connectionstrings.com/sql-server-2008#p2 Also, when you run code, and get an error. It is usually best if you provide us with details of the error so we can best understand what problem you are really having. |
| Re: Vb.net Help by AZeD1(m): 2:20pm On Feb 29, 2012 |
I'm more of a stored procedure person. KoboJunkie are you a programmer? |
| Re: Vb.net Help by 9ja4eva: 6:48pm On Mar 03, 2012 |
Kobojunkie:Kobo do u program in VB? I got a question for you |
| Re: Vb.net Help by Kobojunkie: 12:07am On Mar 04, 2012 |
I think I have posted a response to your question. Please check it. |
| Re: Vb.net Help by 9ja4eva: 6:00am On Mar 04, 2012 |
Yeap Boss i have checked it. I have another concern if you don't mind. |
ASP.NET HELP!¡! Any Programmer Can Give Suggestion. • I Need A Help To Write A Simple Login Form Using Vb.net • Post Ur Vb 6.0 Questions Here • 2 • 3 • 4
Scientific Calculator Help! • Hibernate Envers - EJB , Help Needed • Saving And Retrieving In C++
