Hi
In the below code , it is giving me error [Temp$] is not Valid Name .
Dim cnn As String
cnn = ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Temp.XLS;Extended Properties=Excel 8.0")
Dim ds As New DataSet
Dim dt As New DataTable
Dim excelcnn As New System.Data.OleDb.OleDbConnection(cnn)
Dim excelqry As String
excelqry = "Select * from [TEMP$]"
Thanks
Request clarification before answering.
Hi
TEMP should be your Sheet Name.
Dim Con_Str = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & path & ";Extended Properties=""Excel 12.0 Xml;HDR=YES"";"
con.ConnectionString = Con_Str
If (con.State = ConnectionState.Open) Then con.Close()
con.Open()
Dim DA As New OleDb.OleDbDataAdapter("SELECT * FROM [TEMP$]", con)
Dim Dt As New DataSet
DA.Fill(Dt)
Regards
Parthiban
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Below code is neither giving me any error nor creating any J.E . is the code right . I want to create single J.E
While (excelreader.Read())
i = i + 1
Dim strpartyCode = excelreader.GetValue(0).ToString()
Dim strAcctCode = excelreader.GetValue(1).ToString()
Dim strCredit = excelreader.GetValue(2).ToString()
Dim strDebit = excelreader.GetValue(3).ToString()
Dim strText = excelreader.GetValue(4).ToString()
oJE.TaxDate = Date.Today
oJE.ReferenceDate = Date.Today
oJE.Lines.Credit = dblcredit
oJE.Lines.Debit = dblDebit
oJE.Lines.LineMemo = strText
oJE.Lines.AccountCode = strAcctCode
oJE.Lines.Add()
End While
Thanks
| User | Count |
|---|---|
| 14 | |
| 12 | |
| 7 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.