Hello all,
I'm trying to use VWD 2005 Express Edition to connect to a database.
For my initial prototyping though, I'm just using an Excel
spreadsheet as the source and everything resides on the local host.
All I want to do right now is get the info from the source and display
it on a webpage.
I've dropped a GridView and a SQLDataSource onto the page and
here's the code:
<form id="form1" runat="server">
<div>
<!-- added 5-8-06 -->
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="Driver={Microsoft Excel Driver
(*.xls)};DriverId=790;Dbq=C:\Web\test.xls;DefaultD ir=C:\Web;"
SelectCommand="SELECT * FROM [sheet1$]">
</asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server"
DataSourceID="SqlDataSource1">
</asp:GridView>
</div>
</form>
I've looked at old posts in this group, KB article 311731, and places
like connectionstrings.com. However when I run the app, this error is
thrown:
Server Error in '/WebSite1' Application.
--------------------------------------------------------------------------------
Keyword not supported: 'driver'.
Description: An unhandled exception occurred during the execution
of the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Keyword not supported:
'driver'.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
I'm absolutely perplexed by this error... the description says the
keyword "driver" is not supported. Everything I've read shows the
connection string as I tried using it above. I've even copied and
pasted it (only editing the path to the Excel file) from the KB article
and I still get this error. Any suggestions are greatly appreciated.
Thanks! 3 2037
An SqlDataSource is for use with SQL Server, you can't use it with any
other driver.
Use an OdbcDataSource or OleDbDataSource, depending on what the driver uses.
Adam Sandler wrote: Hello all,
I'm trying to use VWD 2005 Express Edition to connect to a database. For my initial prototyping though, I'm just using an Excel spreadsheet as the source and everything resides on the local host. All I want to do right now is get the info from the source and display it on a webpage.
I've dropped a GridView and a SQLDataSource onto the page and here's the code:
<form id="form1" runat="server"> <div> <!-- added 5-8-06 --> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=C:\Web\test.xls;DefaultD ir=C:\Web;" SelectCommand="SELECT * FROM [sheet1$]"> </asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1"> </asp:GridView> </div> </form>
I've looked at old posts in this group, KB article 311731, and places like connectionstrings.com. However when I run the app, this error is thrown:
Server Error in '/WebSite1' Application.
--------------------------------------------------------------------------------
Keyword not supported: 'driver'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Keyword not supported: 'driver'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
I'm absolutely perplexed by this error... the description says the keyword "driver" is not supported. Everything I've read shows the connection string as I tried using it above. I've even copied and pasted it (only editing the path to the Excel file) from the KB article and I still get this error. Any suggestions are greatly appreciated.
Thanks!
Göran Andersson wrote: An SqlDataSource is for use with SQL Server, you can't use it with any other driver.
Use an OdbcDataSource or OleDbDataSource, depending on what the driver uses.
Thanks for the reply... I do have a followup question though.
Eventually I will be connecting to Oracle; I was hoping all I'd have to
do with the source change was change the connection string. At any
rate, http://msdn2.microsoft.com/en-US/lib...atasource.aspx
says I can use a SqlDataSource for any relational database where SQL is
used. So is this a misprint and it should read the SqlDataSource is
for SQL Server only?
Adam Sandler wrote: Göran Andersson wrote: An SqlDataSource is for use with SQL Server, you can't use it with any other driver.
Use an OdbcDataSource or OleDbDataSource, depending on what the driver uses.
Thanks for the reply... I do have a followup question though. Eventually I will be connecting to Oracle; I was hoping all I'd have to do with the source change was change the connection string. At any rate, http://msdn2.microsoft.com/en-US/lib...atasource.aspx says I can use a SqlDataSource for any relational database where SQL is used. So is this a misprint and it should read the SqlDataSource is for SQL Server only?
It says that it can be used with any SQL relational database that can be
connected to using an ADO.NET provider.
The Excel driver is not an ADO.NET provider. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: nzanella |
last post by:
Hello,
I have MS SQL Server running on a server computer. I am trying
to connect to it via ASP from a .asp file created in a virtual
directory. I am using IIS as the web server. I am connecting...
|
by: CodeImp |
last post by:
A simple app I quickly wrote to try getting info from a database. Here
is the first part of its code. The rest of the code is irellevant.
using System;
using System.Data;
using...
|
by: Thomas Scheiderich |
last post by:
I am having a problem connecting to an Sql Server using Windows
Authentication.
I am using the following command:
server=Raptor;uid=tfs;password=tol1ee;database=ABC;Network Library =dbmssocn
...
|
by: Joner |
last post by:
Hello,
I'm having trouble with a little programme of mine where I connect to
an access database. It seems to connect fine, and disconnect fine, but
then after it won't reconnect, I get the error...
|
by: Sebastian |
last post by:
I'm using the following code to connect to an access 2000
database.
(with reference to adodb)
Public DBvar As New ADODB.Connection()
DBvar.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data...
|
by: MVChauhan |
last post by:
Hi
We are planning to move over to SQL Server 2005 in near future.
At the moment Website is on a seperate server then the Database.
OS for both the server is Window 2003 and currently our data...
|
by: mohsen_fakhari |
last post by:
Hi
I want to see data of a Btrieve database from access 2003.
I have DDF files and the odbc driver and have made a data source.
But to connect to this data source,from file menu,get external...
|
by: ADezii |
last post by:
At some point in time, you may need to make a Connection to an External Data Source residing in a SQL Server Database. There are basically 3 distinct Methods for creating this Connection. I will...
|
by: aboutjav.com |
last post by:
Hi,
I need some help. I am getting this error after I complete the asp.net
register control and click on the continue button. It crashed when it
tries to get
it calls this Profile property
...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |