Hi there,
I am trying to use the new ListView control in VS2008 in an ASP.Net app. My problem starts already with the datasource. I drag and drop a SqlDataSource and select
Microsoft SQL Server Compact 3.5 (.NET Framework Data Provider for Microsoft SQL Server Compact 3.5)
I can connect to the database and test the query in the wizard (I do not need to use a password??)
This is the webconfig entry
<add name="ConnectionString" connectionString="Data Source=C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Samples\Northwind.sdf" providerName="Microsoft.SqlServerCe.Client.3.5"/>
I add the following line in the page load event
AppDomain.CurrentDomain.SetData("SQLServerCompactEditionUnderWebHosting", true);
However I get the error message that the data provider cannot be found and it might not be installed. I added the reference and also gave the folder above ASP.NET full access rights.
Anyone else encountered this problem. It is quiet strange? Thanks a lot for your help.
Cheers,
Chris
Hi,
From your description, it seems that you are wondering why the database creating wizard doesn't ask for your userid and password, and another question is why does you application can't find the data provider, right?
For you first question, I think what the database you created is in Windows Authentication mode, so when you create a database connection wizard, the wizard connects to your database by your windows account. If you want to change the windows authentication mode, you may open your sqlserver enterprise manager, and change the authentication mode to SQL mixed authentication mode in the security part.
Second, from the provider in your connection string, you are using .NET Framework Data Provider for Microsoft SQL Server Compact 3.5. But the application you created is a ASP.NET application, so are you sure you want to connect a SQLServer compact edition. Generally, you should create a SQLServer database and use "System.Data.SqlClient" as the providername in your connection string.
Thanks.
Hi Michael,
of course you are right. I realised yesterday that I just use the wrong data provider. Stupid me. All works fine now.
Thanks again,
Cheers,
Chris
sql
No comments:
Post a Comment