Tuesday, March 20, 2012
asymmetric encryption
goal is to encrypt a couple of tables from one of my dataabses. Thanks!Do not use asymmetric key encryption to protect data; it is too slow for
that purpose, plus there are limitations on how large a piece of data you
can encrypt. For symmetric key encryption examples, see my blog:
http://blogs.msdn.com/lcris/ .
Thanks
Laurentiu Cristofor [MSFT]
Software Design Engineer
SQL Server Engine
http://blogs.msdn.com/lcris/
This posting is provided "AS IS" with no warranties, and confers no rights.
"Keith" <Keith @.discussions.microsoft.com> wrote in message
news:511B39A3-071D-45D7-8C7B-C33C5E744385@.microsoft.com...
> Is there a step by step cookbook on setting up asymmetric encryption. My
> goal is to encrypt a couple of tables from one of my dataabses. Thanks!|||It's an awesome encryption blog. If anyone needs to learn
more on encryption in 2005, it's *the* resource. Just
checked your blog today - thanks for the posting the
proposed updated sp_helprevlogin. Awesome!
Thanks for all time you've put into your blog.
-Sue
SQL Server MVP
On Wed, 5 Apr 2006 10:50:02 -0700, "Laurentiu Cristofor
[MSFT]" <laur@.nospam.com> wrote:
>Do not use asymmetric key encryption to protect data; it is too slow for
>that purpose, plus there are limitations on how large a piece of data you
>can encrypt. For symmetric key encryption examples, see my blog:
>http://blogs.msdn.com/lcris/ .
>Thanks|||Awesome... Thanks for the help. Will this method encrypt data already in m
y
database?
"Laurentiu Cristofor [MSFT]" wrote:
> Do not use asymmetric key encryption to protect data; it is too slow for
> that purpose, plus there are limitations on how large a piece of data you
> can encrypt. For symmetric key encryption examples, see my blog:
> http://blogs.msdn.com/lcris/ .
> Thanks
> --
> Laurentiu Cristofor [MSFT]
> Software Design Engineer
> SQL Server Engine
> http://blogs.msdn.com/lcris/
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> "Keith" <Keith @.discussions.microsoft.com> wrote in message
> news:511B39A3-071D-45D7-8C7B-C33C5E744385@.microsoft.com...
>
>|||Yes, you can encrypt existing data. Here are some caveats: The output of
encryption is varbinary, so if you're trying to encrypt a table column that
is not varbinary, you'll need to change the table definition. The ciphertext
is also larger than the cleartext, so you may need to do this even if your
data is already varbinary; if the column is too small.
One other caveat is that we only allow encrypting values less than 8k.
See this blog entry for additional details:
http://blogs.msdn.com/yukondoit/arc.../24/496521.aspx
Note that the YukonDoIt blog is not active anymore. Raul, who wrote this
post, now has a blog at:
http://blogs.msdn.com/raulga/
Thanks
Laurentiu Cristofor [MSFT]
Software Design Engineer
SQL Server Engine
http://blogs.msdn.com/lcris/
This posting is provided "AS IS" with no warranties, and confers no rights.
"Keith" <Keith@.discussions.microsoft.com> wrote in message
news:2654724A-2B10-4F94-B51E-C1A2B2FD7A30@.microsoft.com...[vbcol=seagreen]
> Awesome... Thanks for the help. Will this method encrypt data already in
> my
> database?
> "Laurentiu Cristofor [MSFT]" wrote:
>|||Thank you. I'm glad you found my blog posts useful.
Laurentiu Cristofor [MSFT]
Software Design Engineer
SQL Server Engine
http://blogs.msdn.com/lcris/
This posting is provided "AS IS" with no warranties, and confers no rights.
"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
news:q0o832t10pvevq2a0v0pl3der2q3vmfau6@.
4ax.com...
> It's an awesome encryption blog. If anyone needs to learn
> more on encryption in 2005, it's *the* resource. Just
> checked your blog today - thanks for the posting the
> proposed updated sp_helprevlogin. Awesome!
> Thanks for all time you've put into your blog.
> -Sue
> SQL Server MVP
> On Wed, 5 Apr 2006 10:50:02 -0700, "Laurentiu Cristofor
> [MSFT]" <laur@.nospam.com> wrote:
>
>|||If you use symmetric encryption do the end users, connecting with a
front-end, need to input a password to acess the encrypted data? Or will
their logging into the system grant them access to the encrypted data?
"Laurentiu Cristofor [MSFT]" wrote:
> Yes, you can encrypt existing data. Here are some caveats: The output of
> encryption is varbinary, so if you're trying to encrypt a table column tha
t
> is not varbinary, you'll need to change the table definition. The cipherte
xt
> is also larger than the cleartext, so you may need to do this even if your
> data is already varbinary; if the column is too small.
> One other caveat is that we only allow encrypting values less than 8k.
> See this blog entry for additional details:
> http://blogs.msdn.com/yukondoit/arc.../24/496521.aspx
> Note that the YukonDoIt blog is not active anymore. Raul, who wrote this
> post, now has a blog at:
> http://blogs.msdn.com/raulga/
> Thanks
> --
> Laurentiu Cristofor [MSFT]
> Software Design Engineer
> SQL Server Engine
> http://blogs.msdn.com/lcris/
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> "Keith" <Keith@.discussions.microsoft.com> wrote in message
> news:2654724A-2B10-4F94-B51E-C1A2B2FD7A30@.microsoft.com...
>
>|||It depends on how you design your database application. Both of these
scenarios are possible.
Laurentiu Cristofor [MSFT]
Software Design Engineer
SQL Server Engine
http://blogs.msdn.com/lcris/
This posting is provided "AS IS" with no warranties, and confers no rights.
"Keith" <Keith@.discussions.microsoft.com> wrote in message
news:D8AE6555-A2C3-499D-838D-546F8D13092A@.microsoft.com...[vbcol=seagreen]
> If you use symmetric encryption do the end users, connecting with a
> front-end, need to input a password to acess the encrypted data? Or will
> their logging into the system grant them access to the encrypted data?
> "Laurentiu Cristofor [MSFT]" wrote:
>
Monday, March 19, 2012
Assigning XML data to variables
Need some assistance here again.
What data type should I use for the variable that I receive from a resultset?
I tried setting it to object, but I encountered some problem later in the stage during the data flow because the XML source adapter cannot get the variable.
I tried setting it to String but get some error during runtime because of invalid datatype.
The main purpose here is actually to get the data from an XML column in a table and populate it into the XML Source Adapter so that I can do some transformations.
Any ideas?
Thanks.Hi,
Yes, this is definitely an issue. In the next release (post- CTP15) you will be able to put the XML result set into a string variable that can then be consumed by the XML Source Adapter. For now, you might be able to work around it with a script component that creates a new string variable and populates it with the data from the object variable. I'm sorry I don't have a better answer for you.
Thanks,
Mark
Friday, February 24, 2012
ASPNETDB.mdf - setting your website to use your hosted DB instead
Hi,
I'm running Visual Web Developer 2005 and have created a small site with a log-in function. In VWD this automatically creates the database ASPNETDB.mdf which stores all the user / log-on data.
I have 1 x MS SQL Server 2005 DB which I am using to store data for my site.
Can anyone advise me on how to setup my site / the ASPNetDB so that it runs on my MS SQL Server?
I've searched the ASP.NET forums etc and this does seem to be an area where people are struggling.
I have tried running the ASP.NET SQL Server Registration Tool (Aspnet_regsql.exe) and get the following error:
"Setup failed.
Exception:
An error occurred during the execution of the SQL file 'InstallCommon.sql'. The SQL error number is 8152 and the SqlException message is: String or binary data would be truncated."
As a beginner I've struggled from downloading an online template, then uploading it to my site, and the log-on doesn't work. There didn't seem any instructions / advice on what to do with the ASPNETDB.mdf database.
Help / advice would be much appreciated!
Thanks,
Tom
Hi gilbert,
This website is a great place to start reading about security and asp.nethttp://weblogs.asp.net/scottgu/archive/2006/02/24/ASP.NET-2.0-Membership_2C00_-Roles_2C00_-Forms-Authentication_2C00_-and-Security-Resources-.aspx
The things you are probably looking for are Windows or Forms Authentication with SQL Server 2000 (or 2005). When you use the log-in control and don't change any of the settings, for example in web.config, all the default settings will be used. Maybe that's what's causing the error.
This is a link on the page mentioned above, it's about forms auth. and it tells you how to set up that aspnetdb. (http://msdn2.microsoft.com/en-us/library/ms998317.aspx)
Hope this helps!
Wim
theres 8 parts to it.
but the first couple talk about what your asking. in the articles tehre are also links to different other pages which can help you configure your site to use the MSSQL database you have.
http://aspnet.4guysfromrolla.com/articles/120705-1.aspx
Monday, February 13, 2012
Asp.Net not finding the SQLServer for setting up Security problem
I have just reciently installed and started upgrading the last beta code to this beta and am having a problem conecting to my sqlinstance with the WebSite Configuration Tool.
The error indicates it is looking for a file in the app_data directory. (empty), but everthing else points to SQLServer (express) as being the issue.
I have run aspnet_regsql.exe (both on my default instance of sql (a sql2kas) and the beta2 instance that shipped with VS.
Both created datasases and eveyting looked good inside the db's.
However when I click the "Securtiy tab" I get a message "Unable to connect to SQL Server Database."
When I go to The Provider Tab, there is nothing to configure, just a test Hlink that generates the following when clicked.
SQLExpress database file auto-creation error:
The connection string specifies a local SQL Server Express instance using a database location within the applications App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The .......
I have run SQL Trace (profiler) against both instances of SQL when aps is trying to connect, but neither show anything.
I keep feeling like I must have missed something.. Anyu clues are welcome.
Rob
This I fixed by editing the Machine.Config file and changing the Connection String for the Database Access. (Can't remember just which one, but if you do a search for SQLExpress in teh machine.config you will find it.)
HTH
Rob|||Here is another approach in using a full blown SQL Server as the repository of your credentials for ASP.NET 2.0 if you do not want to use the default SQL Express.
1) Create a database in SQL Server (2000 or 2005) and make sure that you give the ASPNET account permissions to this database.
2) Run the aspnet_regsql.exe file in your System%Root\Microsoft.NET\Framework\v2.0.xyz directory. This will open an ASP.NET SQL Server Setup Wizard which will create the objects necessary for ASP.NET security.
3) Point to the database you just created.
4) In your web.config file, locate the <connectionStrings> element and add the following:
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=localhost;initial catalog=<your database name>;integrated security=true" providerName="System.Data.SqlClient">
This overrides the default SQL Express and points to the new database you just created - be it in the same machine or a different machine. You can also change the configuration in the machine.config file although this will affect every web application sitting on top of your machine.|||WOW! it did solve my problem. thanks so much|||
Worked !
Thanks a lot.
(I can now start growing my hair back )
Bill
|||I have the same problem :S
<connectionStrings>
<remove name="LocalSqlServer" />
<add name ="LocalSqlServer" connectionString="Data Source=localhost;initial catalog = memberDB;
integrated security=true " providerName="System.Data.SqlClient">
</connectionStrings>
i still get error
Error 4 XML document cannot contain multiple root level elements.
:S:S
<connectionStrings>
<remove name="LocalSqlServer" />
<add name ="LocalSqlServer" connectionString="Data Source=localhost;initial catalog = memberDB;
integrated security=true " providerName="System.Data.SqlClient">
</connectionStrings>
I think your error might be pointing to the Add tag as it is missing the Close Tag. However you seem to have an XML issue, not the issue that started the thread..
Rob
E.G. (highlighted in red)
<add name ="LocalSqlServer" connectionString="Data Source=localhost;initial catalog = memberDB;integrated security=true " providerName="System.Data.SqlClient" />
|||Is it mandatory to have SQL Server for accessing the security features like creating users and roles in ASP.Net Configuration tool? If not please tell me the way to avoid the same problem...
Asp.Net not finding the SQLServer for setting up Security problem
I have just reciently installed and started upgrading the last beta code to this beta and am having a problem conecting to my sqlinstance with the WebSite Configuration Tool.
The error indicates it is looking for a file in the app_data directory. (empty), but everthing else points to SQLServer (express) as being the issue.
I have run aspnet_regsql.exe (both on my default instance of sql (a sql2kas) and the beta2 instance that shipped with VS.
Both created datasases and eveyting looked good inside the db's.
However when I click the "Securtiy tab" I get a message "Unable to connect to SQL Server Database."
When I go to The Provider Tab, there is nothing to configure, just a test Hlink that generates the following when clicked.
SQLExpress database file auto-creation error:
The connection string specifies a local SQL Server Express instance using a database location within the applications App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The .......
I have run SQL Trace (profiler) against both instances of SQL when aps is trying to connect, but neither show anything.
I keep feeling like I must have missed something.. Anyu clues are welcome.
Rob
This I fixed by editing the Machine.Config file and changing the Connection String for the Database Access. (Can't remember just which one, but if you do a search for SQLExpress in teh machine.config you will find it.)
HTH
Rob|||Here is another approach in using a full blown SQL Server as the repository of your credentials for ASP.NET 2.0 if you do not want to use the default SQL Express.
1) Create a database in SQL Server (2000 or 2005) and make sure that you give the ASPNET account permissions to this database.
2) Run the aspnet_regsql.exe file in your System%Root\Microsoft.NET\Framework\v2.0.xyz directory. This will open an ASP.NET SQL Server Setup Wizard which will create the objects necessary for ASP.NET security.
3) Point to the database you just created.
4) In your web.config file, locate the <connectionStrings> element and add the following:
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=localhost;initial catalog=<your database name>;integrated security=true" providerName="System.Data.SqlClient">
This overrides the default SQL Express and points to the new database you just created - be it in the same machine or a different machine. You can also change the configuration in the machine.config file although this will affect every web application sitting on top of your machine.|||WOW! it did solve my problem. thanks so much|||
Worked !
Thanks a lot.
(I can now start growing my hair back )
Bill
|||I have the same problem :S
<connectionStrings>
<remove name="LocalSqlServer" />
<add name ="LocalSqlServer" connectionString="Data Source=localhost;initial catalog = memberDB;
integrated security=true " providerName="System.Data.SqlClient">
</connectionStrings>
i still get error
Error 4 XML document cannot contain multiple root level elements.
:S:S
<connectionStrings>
<remove name="LocalSqlServer" />
<add name ="LocalSqlServer" connectionString="Data Source=localhost;initial catalog = memberDB;
integrated security=true " providerName="System.Data.SqlClient">
</connectionStrings>
I think your error might be pointing to the Add tag as it is missing the Close Tag. However you seem to have an XML issue, not the issue that started the thread..
Rob
E.G. (highlighted in red)
<add name ="LocalSqlServer" connectionString="Data Source=localhost;initial catalog = memberDB;integrated security=true " providerName="System.Data.SqlClient" />
|||Is it mandatory to have SQL Server for accessing the security features like creating users and roles in ASP.Net Configuration tool? If not please tell me the way to avoid the same problem...
Asp.Net not finding the SQLServer for setting up Security problem
I have just reciently installed and started upgrading the last beta code to this beta and am having a problem conecting to my sqlinstance with the WebSite Configuration Tool.
The error indicates it is looking for a file in the app_data directory. (empty), but everthing else points to SQLServer (express) as being the issue.
I have run aspnet_regsql.exe (both on my default instance of sql (a sql2kas) and the beta2 instance that shipped with VS.
Both created datasases and eveyting looked good inside the db's.
However when I click the "Securtiy tab" I get a message "Unable to connect to SQL Server Database."
When I go to The Provider Tab, there is nothing to configure, just a test Hlink that generates the following when clicked.
SQLExpress database file auto-creation error:
The connection string specifies a local SQL Server Express instance using a database location within the applications App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The .......
I have run SQL Trace (profiler) against both instances of SQL when aps is trying to connect, but neither show anything.
I keep feeling like I must have missed something.. Anyu clues are welcome.
Rob
This I fixed by editing the Machine.Config file and changing the Connection String for the Database Access. (Can't remember just which one, but if you do a search for SQLExpress in teh machine.config you will find it.)
HTH
Rob|||Here is another approach in using a full blown SQL Server as the repository of your credentials for ASP.NET 2.0 if you do not want to use the default SQL Express.
1) Create a database in SQL Server (2000 or 2005) and make sure that you give the ASPNET account permissions to this database.
2) Run the aspnet_regsql.exe file in your System%Root\Microsoft.NET\Framework\v2.0.xyz directory. This will open an ASP.NET SQL Server Setup Wizard which will create the objects necessary for ASP.NET security.
3) Point to the database you just created.
4) In your web.config file, locate the <connectionStrings> element and add the following:
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=localhost;initial catalog=<your database name>;integrated security=true" providerName="System.Data.SqlClient">
This overrides the default SQL Express and points to the new database you just created - be it in the same machine or a different machine. You can also change the configuration in the machine.config file although this will affect every web application sitting on top of your machine.|||WOW! it did solve my problem. thanks so much|||
Worked !
Thanks a lot.
(I can now start growing my hair back )
Bill
|||I have the same problem :S
<connectionStrings>
<remove name="LocalSqlServer" />
<add name ="LocalSqlServer" connectionString="Data Source=localhost;initial catalog = memberDB;
integrated security=true " providerName="System.Data.SqlClient">
</connectionStrings>
i still get error
Error 4 XML document cannot contain multiple root level elements.
:S:S
<connectionStrings>
<remove name="LocalSqlServer" />
<add name ="LocalSqlServer" connectionString="Data Source=localhost;initial catalog = memberDB;
integrated security=true " providerName="System.Data.SqlClient">
</connectionStrings>
I think your error might be pointing to the Add tag as it is missing the Close Tag. However you seem to have an XML issue, not the issue that started the thread..
Rob
E.G. (highlighted in red)
<add name ="LocalSqlServer" connectionString="Data Source=localhost;initial catalog = memberDB;integrated security=true " providerName="System.Data.SqlClient" />
|||Is it mandatory to have SQL Server for accessing the security features like creating users and roles in ASP.Net Configuration tool? If not please tell me the way to avoid the same problem...|||
Hi bass_player,
I think I was a bit late in getting this error, but when I got it in 2007 your post of 2005 saved my day.
Thanks a lot
RaghavS
|||hithe first three steps done greatly
the fourth is not
i did not find any<connectionStrings> in my web.config
i'm just a beginer
thank u
|||
Place the <connectionstrings>...</connectionstrings> section right before the <system.web> seciton
Asp.Net not finding the SQLServer for setting up Security problem
I have just reciently installed and started upgrading the last beta code to this beta and am having a problem conecting to my sqlinstance with the WebSite Configuration Tool.
The error indicates it is looking for a file in the app_data directory. (empty), but everthing else points to SQLServer (express) as being the issue.
I have run aspnet_regsql.exe (both on my default instance of sql (a sql2kas) and the beta2 instance that shipped with VS.
Both created datasases and eveyting looked good inside the db's.
However when I click the "Securtiy tab" I get a message "Unable to connect to SQL Server Database."
When I go to The Provider Tab, there is nothing to configure, just a test Hlink that generates the following when clicked.
SQLExpress database file auto-creation error:
The connection string specifies a local SQL Server Express instance using a database location within the applications App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The .......
I have run SQL Trace (profiler) against both instances of SQL when aps is trying to connect, but neither show anything.
I keep feeling like I must have missed something.. Anyu clues are welcome.
Rob
This I fixed by editing the Machine.Config file and changing the Connection String for the Database Access. (Can't remember just which one, but if you do a search for SQLExpress in teh machine.config you will find it.)
HTH
Rob|||Here is another approach in using a full blown SQL Server as the repository of your credentials for ASP.NET 2.0 if you do not want to use the default SQL Express.
1) Create a database in SQL Server (2000 or 2005) and make sure that you give the ASPNET account permissions to this database.
2) Run the aspnet_regsql.exe file in your System%Root\Microsoft.NET\Framework\v2.0.xyz directory. This will open an ASP.NET SQL Server Setup Wizard which will create the objects necessary for ASP.NET security.
3) Point to the database you just created.
4) In your web.config file, locate the <connectionStrings> element and add the following:
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=localhost;initial catalog=<your database name>;integrated security=true" providerName="System.Data.SqlClient">
This overrides the default SQL Express and points to the new database you just created - be it in the same machine or a different machine. You can also change the configuration in the machine.config file although this will affect every web application sitting on top of your machine.|||WOW! it did solve my problem. thanks so much|||
Worked !
Thanks a lot.
(I can now start growing my hair back )
Bill
|||I have the same problem :S
<connectionStrings>
<remove name="LocalSqlServer" />
<add name ="LocalSqlServer" connectionString="Data Source=localhost;initial catalog = memberDB;
integrated security=true " providerName="System.Data.SqlClient">
</connectionStrings>
i still get error
Error 4 XML document cannot contain multiple root level elements.
:S:S
<connectionStrings>
<remove name="LocalSqlServer" />
<add name ="LocalSqlServer" connectionString="Data Source=localhost;initial catalog = memberDB;
integrated security=true " providerName="System.Data.SqlClient">
</connectionStrings>
I think your error might be pointing to the Add tag as it is missing the Close Tag. However you seem to have an XML issue, not the issue that started the thread..
Rob
E.G. (highlighted in red)
<add name ="LocalSqlServer" connectionString="Data Source=localhost;initial catalog = memberDB;integrated security=true " providerName="System.Data.SqlClient" />
|||Is it mandatory to have SQL Server for accessing the security features like creating users and roles in ASP.Net Configuration tool? If not please tell me the way to avoid the same problem...|||
Hi bass_player,
I think I was a bit late in getting this error, but when I got it in 2007 your post of 2005 saved my day.
Thanks a lot
RaghavS
|||hithe first three steps done greatly
the fourth is not
i did not find any <connectionStrings> in my web.config
i'm just a beginer
thank u
|||
Place the <connectionstrings>...</connectionstrings> section right before the <system.web> seciton
Asp.Net not finding the SQLServer for setting up Security problem
I have just reciently installed and started upgrading the last beta code to this beta and am having a problem conecting to my sqlinstance with the WebSite Configuration Tool.
The error indicates it is looking for a file in the app_data directory. (empty), but everthing else points to SQLServer (express) as being the issue.
I have run aspnet_regsql.exe (both on my default instance of sql (a sql2kas) and the beta2 instance that shipped with VS.
Both created datasases and eveyting looked good inside the db's.
However when I click the "Securtiy tab" I get a message "Unable to connect to SQL Server Database."
When I go to The Provider Tab, there is nothing to configure, just a test Hlink that generates the following when clicked.
SQLExpress database file auto-creation error:
The connection string specifies a local SQL Server Express instance using a database location within the applications App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The .......
I have run SQL Trace (profiler) against both instances of SQL when aps is trying to connect, but neither show anything.
I keep feeling like I must have missed something.. Anyu clues are welcome.
Rob
This I fixed by editing the Machine.Config file and changing the Connection String for the Database Access. (Can't remember just which one, but if you do a search for SQLExpress in teh machine.config you will find it.)
HTH
Rob|||Here is another approach in using a full blown SQL Server as the repository of your credentials for ASP.NET 2.0 if you do not want to use the default SQL Express.
1) Create a database in SQL Server (2000 or 2005) and make sure that you give the ASPNET account permissions to this database.
2) Run the aspnet_regsql.exe file in your System%Root\Microsoft.NET\Framework\v2.0.xyz directory. This will open an ASP.NET SQL Server Setup Wizard which will create the objects necessary for ASP.NET security.
3) Point to the database you just created.
4) In your web.config file, locate the <connectionStrings> element and add the following:
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=localhost;initial catalog=<your database name>;integrated security=true" providerName="System.Data.SqlClient">
This overrides the default SQL Express and points to the new database you just created - be it in the same machine or a different machine. You can also change the configuration in the machine.config file although this will affect every web application sitting on top of your machine.|||WOW! it did solve my problem. thanks so much|||
Worked !
Thanks a lot.
(I can now start growing my hair back )
Bill
|||I have the same problem :S
<connectionStrings>
<remove name="LocalSqlServer" />
<add name ="LocalSqlServer" connectionString="Data Source=localhost;initial catalog = memberDB;
integrated security=true " providerName="System.Data.SqlClient">
</connectionStrings>
i still get error
Error 4 XML document cannot contain multiple root level elements.
:S:S
<connectionStrings>
<remove name="LocalSqlServer" />
<add name ="LocalSqlServer" connectionString="Data Source=localhost;initial catalog = memberDB;
integrated security=true " providerName="System.Data.SqlClient">
</connectionStrings>
I think your error might be pointing to the Add tag as it is missing the Close Tag. However you seem to have an XML issue, not the issue that started the thread..
Rob
E.G. (highlighted in red)
<add name ="LocalSqlServer" connectionString="Data Source=localhost;initial catalog = memberDB;integrated security=true " providerName="System.Data.SqlClient" />
|||Is it mandatory to have SQL Server for accessing the security features like creating users and roles in ASP.Net Configuration tool? If not please tell me the way to avoid the same problem...|||
Hi bass_player,
I think I was a bit late in getting this error, but when I got it in 2007 your post of 2005 saved my day.
Thanks a lot
RaghavS
|||hithe first three steps done greatly
the fourth is not
i did not find any <connectionStrings> in my web.config
i'm just a beginer
thank u
|||
Place the <connectionstrings>...</connectionstrings> section right before the <system.web> seciton
Asp.Net not finding the SQLServer for setting up Security problem
I have just reciently installed and started upgrading the last beta code to this beta and am having a problem conecting to my sqlinstance with the WebSite Configuration Tool.
The error indicates it is looking for a file in the app_data directory. (empty), but everthing else points to SQLServer (express) as being the issue.
I have run aspnet_regsql.exe (both on my default instance of sql (a sql2kas) and the beta2 instance that shipped with VS.
Both created datasases and eveyting looked good inside the db's.
However when I click the "Securtiy tab" I get a message "Unable to connect to SQL Server Database."
When I go to The Provider Tab, there is nothing to configure, just a test Hlink that generates the following when clicked.
SQLExpress database file auto-creation error:
The connection string specifies a local SQL Server Express instance using a database location within the applications App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The .......
I have run SQL Trace (profiler) against both instances of SQL when aps is trying to connect, but neither show anything.
I keep feeling like I must have missed something.. Anyu clues are welcome.
Rob
This I fixed by editing the Machine.Config file and changing the Connection String for the Database Access. (Can't remember just which one, but if you do a search for SQLExpress in teh machine.config you will find it.)
HTH
Rob|||Here is another approach in using a full blown SQL Server as the repository of your credentials for ASP.NET 2.0 if you do not want to use the default SQL Express.
1) Create a database in SQL Server (2000 or 2005) and make sure that you give the ASPNET account permissions to this database.
2) Run the aspnet_regsql.exe file in your System%Root\Microsoft.NET\Framework\v2.0.xyz directory. This will open an ASP.NET SQL Server Setup Wizard which will create the objects necessary for ASP.NET security.
3) Point to the database you just created.
4) In your web.config file, locate the <connectionStrings> element and add the following:
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=localhost;initial catalog=<your database name>;integrated security=true" providerName="System.Data.SqlClient">
This overrides the default SQL Express and points to the new database you just created - be it in the same machine or a different machine. You can also change the configuration in the machine.config file although this will affect every web application sitting on top of your machine.|||WOW! it did solve my problem. thanks so much|||
Worked !
Thanks a lot.
(I can now start growing my hair back )
Bill
|||I have the same problem :S
<connectionStrings>
<remove name="LocalSqlServer" />
<add name ="LocalSqlServer" connectionString="Data Source=localhost;initial catalog = memberDB;
integrated security=true " providerName="System.Data.SqlClient">
</connectionStrings>
i still get error
Error 4 XML document cannot contain multiple root level elements.
:S:S
<connectionStrings>
<remove name="LocalSqlServer" />
<add name ="LocalSqlServer" connectionString="Data Source=localhost;initial catalog = memberDB;
integrated security=true " providerName="System.Data.SqlClient">
</connectionStrings>
I think your error might be pointing to the Add tag as it is missing the Close Tag. However you seem to have an XML issue, not the issue that started the thread..
Rob
E.G. (highlighted in red)
<add name ="LocalSqlServer" connectionString="Data Source=localhost;initial catalog = memberDB;integrated security=true " providerName="System.Data.SqlClient" />
|||Is it mandatory to have SQL Server for accessing the security features like creating users and roles in ASP.Net Configuration tool? If not please tell me the way to avoid the same problem...
Asp.Net not finding the SQLServer for setting up Security problem
I have just reciently installed and started upgrading the last beta code to this beta and am having a problem conecting to my sqlinstance with the WebSite Configuration Tool.
The error indicates it is looking for a file in the app_data directory. (empty), but everthing else points to SQLServer (express) as being the issue.
I have run aspnet_regsql.exe (both on my default instance of sql (a sql2kas) and the beta2 instance that shipped with VS.
Both created datasases and eveyting looked good inside the db's.
However when I click the "Securtiy tab" I get a message "Unable to connect to SQL Server Database."
When I go to The Provider Tab, there is nothing to configure, just a test Hlink that generates the following when clicked.
SQLExpress database file auto-creation error:
The connection string specifies a local SQL Server Express instance using a database location within the applications App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The .......
I have run SQL Trace (profiler) against both instances of SQL when aps is trying to connect, but neither show anything.
I keep feeling like I must have missed something.. Anyu clues are welcome.
Rob
This I fixed by editing the Machine.Config file and changing the Connection String for the Database Access. (Can't remember just which one, but if you do a search for SQLExpress in teh machine.config you will find it.)
HTH
Rob|||Here is another approach in using a full blown SQL Server as the repository of your credentials for ASP.NET 2.0 if you do not want to use the default SQL Express.
1) Create a database in SQL Server (2000 or 2005) and make sure that you give the ASPNET account permissions to this database.
2) Run the aspnet_regsql.exe file in your System%Root\Microsoft.NET\Framework\v2.0.xyz directory. This will open an ASP.NET SQL Server Setup Wizard which will create the objects necessary for ASP.NET security.
3) Point to the database you just created.
4) In your web.config file, locate the <connectionStrings> element and add the following:
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=localhost;initial catalog=<your database name>;integrated security=true" providerName="System.Data.SqlClient">
This overrides the default SQL Express and points to the new database you just created - be it in the same machine or a different machine. You can also change the configuration in the machine.config file although this will affect every web application sitting on top of your machine.|||WOW! it did solve my problem. thanks so much|||
Worked !
Thanks a lot.
(I can now start growing my hair back )
Bill
|||I have the same problem :S
<connectionStrings>
<remove name="LocalSqlServer" />
<add name ="LocalSqlServer" connectionString="Data Source=localhost;initial catalog = memberDB;
integrated security=true " providerName="System.Data.SqlClient">
</connectionStrings>
i still get error
Error 4 XML document cannot contain multiple root level elements.
:S:S
<connectionStrings>
<remove name="LocalSqlServer" />
<add name ="LocalSqlServer" connectionString="Data Source=localhost;initial catalog = memberDB;
integrated security=true " providerName="System.Data.SqlClient">
</connectionStrings>
I think your error might be pointing to the Add tag as it is missing the Close Tag. However you seem to have an XML issue, not the issue that started the thread..
Rob
E.G. (highlighted in red)
<add name ="LocalSqlServer" connectionString="Data Source=localhost;initial catalog = memberDB;integrated security=true " providerName="System.Data.SqlClient" />
|||Is it mandatory to have SQL Server for accessing the security features like creating users and roles in ASP.Net Configuration tool? If not please tell me the way to avoid the same problem...
Thursday, February 9, 2012
ASP.NET + SQL 2005
I'm using Web.Config as the file to setup the connection:
<connectionStrings
<add name="AMConn" connectionString="Data Source=TWS_WS04;Initial Catalog=AccessMed;Integrated Security=True"
providerName="System.Data.SqlClient" /
</connectionStrings
My connection to the db from aspx file:
string strSQL = "SELECT * FROM Client";
SqlConnection myConnection = new SqlConnection(ConfigurationManager.AppSettings["AMConn"]);
SqlDataAdapter myCommand = new SqlDataAdapter(strSQL, myConnection);
DataSet objDataSet = new DataSet();
myCommand.Fill(objDataSet, "Client");
DataTable objDataTable = objDataSet.Tables["Client"];
And the error message: "The ConnectionString property has not been initialized."
I know that there is a problem with my connection because no matter what I put as AppSettings["ANYTHING I WANT"]); - the error is always the same.
I'm new to asp.net and I would appreciate any help.
Thanks,
JimUse the specific newsgroups for 2005 questions:
http://communities.microsoft.com/ne...welcomePage.htm
--
David Portas
SQL Server MVP
--|||aspx.cs file. I'm using C# as code behind.
"draku" <jkafara@.hotmail.com> wrote in message
My connection to the db from aspx file:|||GOT IT!
If anyone ever have the same problem this is the solution:
SqlConnection myConnection = new SqlConnection(ConfigurationManager.ConnectionStrin gs["AMConn"].ConnectionString);
"draku" <jkafara@.hotmail.com> wrote in message news:dhhakm$dln$1@.inews.gazeta.pl...
Guys, I have a problem with setting up connection from asp file to MS Sql db.
I'm using Web.Config as the file to setup the connection:
<connectionStrings
<add name="AMConn" connectionString="Data Source=TWS_WS04;Initial Catalog=AccessMed;Integrated Security=True"
providerName="System.Data.SqlClient" /
</connectionStrings
My connection to the db from aspx file:
string strSQL = "SELECT * FROM Client";
SqlConnection myConnection = new SqlConnection(ConfigurationManager.AppSettings["AMConn"]);
SqlDataAdapter myCommand = new SqlDataAdapter(strSQL, myConnection);
DataSet objDataSet = new DataSet();
myCommand.Fill(objDataSet, "Client");
DataTable objDataTable = objDataSet.Tables["Client"];
And the error message: "The ConnectionString property has not been initialized."
I know that there is a problem with my connection because no matter what I put as AppSettings["ANYTHING I WANT"]); - the error is always the same.
I'm new to asp.net and I would appreciate any help.
Thanks,
Jim