

MsgBox("Unable to Insert Data! Check Fields!", vbOKOnly, "BASIC TAXI") If TxtCtrlNo.Text "" And txtEmpNo.Text "" And txtCheckOutDate.Text "" And txtCheckOutTime.Text "" And txtTaxiUnitNo.Text "" And txtPlateNo.Text "" And txtModel.Text "" And txtMake.Text "" Then Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click MessageBox.Show("Error On Inserting Data to Database." & ex.Message) MsgBox("Inserting Information Success!", MsgBoxStyle.Information) HERE is my codes for INSERTING DATA but the problem is I don't know how to use it for SEARCHING Imports Ĭon.ConnectionString = "Data Source=(local) Initial Catalog=OJT Persist Security Info=True User ID=sa Password="ĭim cmd As New SqlCommand("INSERT INTO dbo.ChkInOut(ControlNo,EmpNo,TaxiNo,PlateNo,Model,Make,CheckOutDate,CheckOutTime) VALUES('" + TxtCtrlNo.Text + "','" + txtEmpNo.Text + "','" + txtTaxiUnitNo.Text + "','" + txtPlateNo.Text + "','" + txtModel.Text + "','" + txtMake.Text + "','" + txtCheckOutDate.Text + "','" + txtCheckOutTime.Text + "') ", con) I'm a newbie in VB2010 so please don't judge me too much. New OleDbConnection(ConfigurationManager.*It's my first time here but the way I see things around here is good String selectFromFile = ConfigurationManager.AppSettings For the purposes of this example Product_bc is a heap. The underlying database (let's call it simply TestBC) uses the bulk logged recovery model and contains the Product_bc table in which we'll bulk insert the data from the csv file. The data will be loaded into a DataTable, processed and finally bulk inserted into a SQL table. The sample application I'll talk about uses as a csv source file with about 42000 lines containing product price data. You can only use SqlBulkCopy to import data into SQL tables from any source which can be loaded into a DataTable or read with an IDataReader - for example you can import data directly from a SqlDataReader As always, when choosing a tool to work with it's useful to know its limitations. The SqlBulkCopy class functionality is similar to the BULK INSERT statement and to the bcp utility with the "in" argument. In this tip I'll walk you through a simple console application which will demonstrate the basic usage of this class and some options you should be aware of. Another situation when SqlBulkCopy is useful is the data migration to SQL Azure. Thus you benefit from the advanced error handling offered by the.

NET custom step in order to do the initial data import in a Visual Studio application installer. Knowing about the SqlBulkCopy class is most helpful if you need to load large amounts of data into your database from within a. By: Diana Moldovan | Updated: | Comments (3) | Related: More > Application Development
