Click here to Skip to main content
16,006,006 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionCatching Embedded Events Pin
Sam Heller13-Nov-06 6:07
Sam Heller13-Nov-06 6:07 
AnswerRe: Catching Embedded Events Pin
indianet13-Nov-06 8:14
indianet13-Nov-06 8:14 
QuestionCreate DataGrid from Excel File Pin
alexfromto13-Nov-06 5:59
alexfromto13-Nov-06 5:59 
AnswerRe: Create DataGrid from Excel File Pin
Sam Heller13-Nov-06 6:10
Sam Heller13-Nov-06 6:10 
GeneralRe: Create DataGrid from Excel File Pin
alexfromto13-Nov-06 6:16
alexfromto13-Nov-06 6:16 
GeneralRe: Create DataGrid from Excel File Pin
Sam Heller13-Nov-06 12:48
Sam Heller13-Nov-06 12:48 
GeneralRe: Create DataGrid from Excel File Pin
alexfromto14-Nov-06 3:05
alexfromto14-Nov-06 3:05 
GeneralRe: Create DataGrid from Excel File Pin
alexfromto14-Nov-06 3:22
alexfromto14-Nov-06 3:22 
OK. I figured it out with the help of a samrt man of course. Smile | :)
Here's the code and it will work. I hope that I can save some time to others if they need to do the same thing I do now.

Enjoy.

Try<br />
            'Create DataSet and DataAdapter<br />
            ds = New System.Data.DataSet<br />
            da = New System.Data.OleDb.OleDbDataAdapter<br />
<br />
           con = New System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Session("ExcelFilePath").ToString() & ";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1;MaxScanRows=0""")<br />
<br />
            'Create command<br />
            cmdSelectExcel = New System.Data.OleDb.OleDbCommand("SELECT c.[Company], c.[Journal Entry], c.[Vendor] FROM [Sheet1$] AS c ORDER BY c.[Company]", con)<br />
<br />
            'Open connection<br />
            con.Open()<br />
<br />
            'Exectue command through adapter<br />
            da.SelectCommand = cmdSelectExcel<br />
            da.Fill(ds, "Company")<br />
<br />
            'Assign DataSourse of the DataGrid and bind it<br />
            dg.DataSource = ds.Tables(0).DefaultView<br />
            dg.DataBind()<br />
<br />
            'Close Connection<br />
            con.Close()<br />
        Catch ex As Exception<br />
            'Display error message<br />
            lblError.Text = "Error: " & ex.ToString()<br />
            lblError.Visible = True<br />
        End Try

QuestionWill I be limited by Crystal Reports licensing for this issue? Pin
Goalie3513-Nov-06 5:54
Goalie3513-Nov-06 5:54 
QuestionWeb promotion Pin
Nitin198113-Nov-06 5:45
Nitin198113-Nov-06 5:45 
AnswerRe: Web promotion Pin
PavanPareta13-Nov-06 19:48
PavanPareta13-Nov-06 19:48 
QuestionDataGrid & GridView Pin
Rahithi13-Nov-06 4:51
Rahithi13-Nov-06 4:51 
AnswerRe: DataGrid & GridView Pin
Sam Heller13-Nov-06 6:12
Sam Heller13-Nov-06 6:12 
QuestionLinking to a website Pin
kgotsob13-Nov-06 4:51
kgotsob13-Nov-06 4:51 
AnswerRe: Linking to a website Pin
indianet13-Nov-06 8:17
indianet13-Nov-06 8:17 
QuestionHow to use Validation control Pin
Sam.M13-Nov-06 4:45
Sam.M13-Nov-06 4:45 
AnswerRe: How to use Validation control Pin
Parwej Ahamad13-Nov-06 5:54
professionalParwej Ahamad13-Nov-06 5:54 
QuestionUnable to take websetup Pin
Sivaprasad C13-Nov-06 3:41
Sivaprasad C13-Nov-06 3:41 
QuestionFree Web Service??? Pin
QuickerThanYourAverageTurtle13-Nov-06 3:32
QuickerThanYourAverageTurtle13-Nov-06 3:32 
Questionproxy Pin
biaali13-Nov-06 3:15
biaali13-Nov-06 3:15 
AnswerRe: proxy Pin
minhpc_bk13-Nov-06 14:02
minhpc_bk13-Nov-06 14:02 
QuestionHow to execute a General WebPage and Get Response? Pin
pubududilena13-Nov-06 2:57
pubududilena13-Nov-06 2:57 
AnswerRe: How to execute a General WebPage and Get Response? Pin
Sandeep Akhare13-Nov-06 4:02
Sandeep Akhare13-Nov-06 4:02 
GeneralRe: How to execute a General WebPage and Get Response? Pin
pubududilena13-Nov-06 17:57
pubududilena13-Nov-06 17:57 
GeneralRe: How to execute a General WebPage and Get Response? Pin
Sandeep Akhare13-Nov-06 19:02
Sandeep Akhare13-Nov-06 19:02 

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.