Click here to Skip to main content
15,913,610 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: sqlConnection object Sql Server setup Pin
ToddHileHoffer14-Jan-09 7:24
ToddHileHoffer14-Jan-09 7:24 
Questionhow to View text file Pin
netJP12L14-Jan-09 6:15
netJP12L14-Jan-09 6:15 
AnswerRe: how to View text file Pin
ToddHileHoffer14-Jan-09 7:11
ToddHileHoffer14-Jan-09 7:11 
GeneralRe: how to View text file Pin
netJP12L14-Jan-09 7:30
netJP12L14-Jan-09 7:30 
GeneralRe: how to View text file Pin
ToddHileHoffer14-Jan-09 7:44
ToddHileHoffer14-Jan-09 7:44 
GeneralRe: how to View text file Pin
N a v a n e e t h14-Jan-09 15:59
N a v a n e e t h14-Jan-09 15:59 
AnswerRe: how to View text file Pin
MitchellBaldwin14-Jan-09 7:18
MitchellBaldwin14-Jan-09 7:18 
QuestionReading Excel Data Pin
Bharathy Sadagopan14-Jan-09 5:53
Bharathy Sadagopan14-Jan-09 5:53 
I have the following vb.net code to read the excel data into a dataset. The code works fine and the excel data is converted to a dataset. If the excel file has a data in the same column in which some numbers are formatted as text (eg. 080) and some numbers are not formatted as text but formatted as numbers (eg. 100.01) then the dataset contains empty values for the ones that are formatted as numbers. Is there anyway to get those values as text?

Thanks,
Bharathy.

Public Shared Function GetDataSetFromExcel(ByVal excelFileName As String) As DataSet
Dim con As OleDbConnection
Dim dt As DataTable
Dim conStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + excelFileName + ";Extended Properties=Excel 8.0;"
con = New OleDbConnection(conStr)
Try

con.Open()
dt = con.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing)
If (dt IsNot Nothing) Then
Dim excelSheetNames(dt.Rows.Count) As String
Dim i As Integer = 0
For Each row As DataRow In dt.Rows
excelSheetNames(i) = row("TABLE_NAME").ToString()
i = i + 1
Next
Dim myCommand As OleDbDataAdapter = New OleDbDataAdapter("SELECT * FROM [" + excelSheetNames(0) + "]", con)

Dim myDataSet As New DataSet()
myCommand.Fill(myDataSet)
Return myDataSet

Else
Return Nothing
End If


Catch ex As Exception
Throw (ex)
Finally
con.Close()
End Try

End Function
AnswerRe: Reading Excel Data Pin
pmarfleet14-Jan-09 11:10
pmarfleet14-Jan-09 11:10 
GeneralRe: Reading Excel Data Pin
Bharathy Sadagopan15-Jan-09 5:08
Bharathy Sadagopan15-Jan-09 5:08 
QuestionASP.NET Dynamic Data Pin
gantww14-Jan-09 5:42
gantww14-Jan-09 5:42 
QuestionDispose a datatable Pin
Member 236391614-Jan-09 4:48
Member 236391614-Jan-09 4:48 
AnswerRe: Dispose a datatable Pin
Aman Bhullar14-Jan-09 4:54
Aman Bhullar14-Jan-09 4:54 
GeneralRe: Dispose a datatable Pin
Christian Graus14-Jan-09 5:12
protectorChristian Graus14-Jan-09 5:12 
QuestionHow to use group by in datatable in c#? Pin
Member 236391614-Jan-09 3:04
Member 236391614-Jan-09 3:04 
QuestionAccess to bin folder denied because of forms authentication Pin
oceanexplorer8214-Jan-09 2:40
oceanexplorer8214-Jan-09 2:40 
Questionradio button binding Pin
cooltoad12314-Jan-09 2:26
cooltoad12314-Jan-09 2:26 
AnswerRe: radio button binding Pin
_AK_14-Jan-09 2:31
_AK_14-Jan-09 2:31 
GeneralRe: radio button binding Pin
cooltoad12314-Jan-09 2:33
cooltoad12314-Jan-09 2:33 
GeneralRe: radio button binding Pin
_AK_14-Jan-09 2:41
_AK_14-Jan-09 2:41 
QuestionHow can I make my asp.net 2.0 web application display exactly the same in firefox as in IE? Pin
Nada Adel14-Jan-09 2:20
Nada Adel14-Jan-09 2:20 
AnswerRe: How can I make my asp.net 2.0 web application display exactly the same in firefox as in IE? Pin
Christian Graus14-Jan-09 2:21
protectorChristian Graus14-Jan-09 2:21 
AnswerRe: How can I make my asp.net 2.0 web application display exactly the same in firefox as in IE? Pin
oceanexplorer8214-Jan-09 2:35
oceanexplorer8214-Jan-09 2:35 
AnswerRe: How can I make my asp.net 2.0 web application display exactly the same in firefox as in IE? Pin
Boro_Bob14-Jan-09 2:55
Boro_Bob14-Jan-09 2:55 
GeneralRe: How can I make my asp.net 2.0 web application display exactly the same in firefox as in IE? Pin
Nada Adel14-Jan-09 3:27
Nada Adel14-Jan-09 3:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.