Click here to Skip to main content
16,006,001 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionsum up rows in excel Pin
priy@31-May-09 21:29
priy@31-May-09 21:29 
AnswerRe: sum up rows in excel Pin
Dalek Dave31-May-09 21:35
professionalDalek Dave31-May-09 21:35 
GeneralRe: sum up rows in excel Pin
priy@31-May-09 21:44
priy@31-May-09 21:44 
GeneralRe: sum up rows in excel Pin
Dalek Dave31-May-09 22:42
professionalDalek Dave31-May-09 22:42 
GeneralRe: sum up rows in excel Pin
priy@31-May-09 23:27
priy@31-May-09 23:27 
GeneralRe: sum up rows in excel Pin
Dalek Dave31-May-09 23:39
professionalDalek Dave31-May-09 23:39 
GeneralRe: sum up rows in excel Pin
priy@1-Jun-09 0:00
priy@1-Jun-09 0:00 
GeneralRe: sum up rows in excel Pin
Dalek Dave1-Jun-09 1:01
professionalDalek Dave1-Jun-09 1:01 
My Mistake, Try this...


<br />
Imports System.Data<br />
Imports System.Data.OleDb<br />
Imports System.IO<br />
<br />
Public Class Form1<br />
<br />
      Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
            'I made this to collect all data from a sheet, you can modify as per need<br />
            'by declaring a range like [Sheet1$A1:B20"]<br />
            Dim sqlData As String = "SELECT * FROM [Sheet1$]"<br />
<br />
            'To put data in a table with fieldnames then HDR should Yes and if not then No.<br />
            Dim xlCon As String = "Provider=Microsoft.Jet.OLEDB.4.0;" _<br />
                                    &amp; "Data Source= 
PATH\SHEETNAME.XLS
" _<br />
                                    &amp; "Extended Properties=""Excel 8.0;HDR=NO"""<br />
<br />
            Dim conn As New OleDbConnection(xlCon)<br />
            Dim da As New OleDbDataAdapter(sqlData, conn)<br />
            Dim dsXLData As New DataSet<br />
            da.Fill(dsXLData, "Source")<br />
            Me.DataGridView1.DataSource = dsXLData.Tables("Source")<br />
<br />
            dsXLData.Dispose()<br />
            da.Dispose()<br />
            conn.Dispose()<br />
<br />
      End Sub<br />
End Class<br />


------------------------------------

"When Belly Full, Chin Hit Chest"
Confucius 502BC

GeneralRe: sum up rows in excel Pin
priy@3-Jun-09 19:17
priy@3-Jun-09 19:17 
GeneralRe: sum up rows in excel Pin
Dalek Dave3-Jun-09 22:29
professionalDalek Dave3-Jun-09 22:29 
Questionhi any one plzzz help urgent Pin
harieshkumar.n31-May-09 20:32
harieshkumar.n31-May-09 20:32 
AnswerRe: hi any one plzzz help urgent Pin
Christian Graus31-May-09 21:51
protectorChristian Graus31-May-09 21:51 
AnswerRe: hi any one plzzz help urgent Pin
0x3c01-Jun-09 0:29
0x3c01-Jun-09 0:29 
AnswerRe: hi any one plzzz help urgent Pin
Dave Kreskowiak1-Jun-09 2:06
mveDave Kreskowiak1-Jun-09 2:06 
QuestionImage not loading in Crystal Report Pin
Ovais Memon31-May-09 19:52
Ovais Memon31-May-09 19:52 
AnswerRe: Image not loading in Crystal Report Pin
Kschuler1-Jun-09 8:12
Kschuler1-Jun-09 8:12 
QuestionHow do I track in which line the error exactly occurs ? Pin
tiagu31-May-09 4:55
tiagu31-May-09 4:55 
AnswerRe: How do I track in which line the error exactly occurs ? Pin
Dave Kreskowiak31-May-09 5:45
mveDave Kreskowiak31-May-09 5:45 
GeneralRe: How do I track in which line the error exactly occurs ? Pin
tiagu31-May-09 21:28
tiagu31-May-09 21:28 
GeneralRe: How do I track in which line the error exactly occurs ? Pin
Dave Kreskowiak1-Jun-09 1:47
mveDave Kreskowiak1-Jun-09 1:47 
AnswerRe: How do I track in which line the error exactly occurs ? Pin
dan!sh 31-May-09 5:49
professional dan!sh 31-May-09 5:49 
AnswerRe: How do I track in which line the error exactly occurs ? Pin
Christian Graus31-May-09 12:27
protectorChristian Graus31-May-09 12:27 
QuestionHow do you populate an array with dataset values Pin
directred31-May-09 1:12
directred31-May-09 1:12 
AnswerRe: How do you populate an array with dataset values Pin
0x3c031-May-09 1:23
0x3c031-May-09 1:23 
AnswerRe: How do you populate an array with dataset values Pin
Johan Hakkesteegt31-May-09 19:56
Johan Hakkesteegt31-May-09 19:56 

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.