On Thu, 17 Jun 2004 23:31:30 -0700, "Mamatha" <ma***********@yahoo.com> wrote:
¤ I have one table in Excel database and i want to insert a
¤ new row to that table.I don't have that much of knowledge
¤ to insert a new row into that table through VB.NET.If any
¤ one can know,Please reply me..
You can use ADO.NET to do this:
Dim ConnectionString As String
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=e:\My Documents\Book20.xls;Extended Properties=""Excel 8.0;HDR=NO"""
Dim ExcelConnection As New System.Data.OleDb.OleDbConnection(ConnectionString )
ExcelConnection.Open()
Dim ExcelCommand As System.Data.OleDb.OleDbCommand = ExcelConnection.CreateCommand()
ExcelCommand.CommandText = "Insert Into [Table4$] (F1, F2, F3) Values (9, 'new', 'row')"
ExcelCommand.CommandType = CommandType.Text
ExcelCommand.ExecuteNonQuery()
ExcelConnection.Close()
Paul ~~~
pc******@ameritech.net
Microsoft MVP (Visual Basic)