New Message on dotNET User Group Hyd

Populating Excel to DataSet

Reply
  Reply to Sender   Recommend Message 3 in Discussion
From: sujith_s

Hi Sathak,

Thanks for your time. Thats what I assume, Pls find below code snipet,

-----------------------Code Snipet Start---------------------------

'Create Excel Connection
Dim strConnXls As String =
"Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & strFileName & ";" &
"Extended Properties=""Excel 8.0;HDR=NO"""
Dim conXls As New OleDb.OleDbConnection(strConnXls)
Dim sdaXls As New OleDb.OleDbDataAdapter("Select * From
[Sheet1$]", conXls)
Dim dsXLS As DataSet = New DataSet
sdaXls.Fill(dsXLS, "SHEET")

If dsXLS.Tables("SHEET").Rows.Count > 0 Then
For intCounter = 0 To
dsXLS.Tables("SHEET").Rows.Count - 1
drXLS =
dsXLS.Tables("SHEET").Rows(intCounter)
'Send this Data row to a different
function and get the value of defined
'column index, it returns DBNULL even
if value is there
Next
End If

-----------------------Code Snipet End---------------------------

Please let me know if the above code is good enough.

Thanks

Cheers
Sujith

_________________________________________________________________
The all-new MSN Mesenger! Get the coolest emoticons.
http://server1.msn.co.in/sp04/messengerchat/ Share more of yourself!

View other groups in this category.

Click here
Also on MSN:
Start Chatting | Listen to Music | House & Home | Try Online Dating | Daily Horoscopes

To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings.

Need help? If you've forgotten your password, please go to Passport Member Services.
For other questions or feedback, go to our Contact Us page.

If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list.
Remove my e-mail address from dotNET User Group Hyd.

Reply via email to