The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
| |
|
Re: ConnectionStrings
Posted: 02 Aug 06 7:47 AM
|
fiogf49gjkf0d try this.......
assword=ersist Security Info=False;User ID=admin;Initial Catalog=slxacp;Data Source=CRMX01;Extended Properties=PORT=1706;LOG=ON">
I have VS2003 apps running with this key...
Also did you install the provider in the webserver you are going to use this?
|
|
|
| |
| |
|
Re: ConnectionStrings
Posted: 02 Aug 06 9:14 AM
|
fiogf49gjkf0d Actually I wonder if its the type of Data source I'm using, at the moment I'm using a SQLDataSource...... I wonder if this should be an ObjectDataSource? |
|
|
|
Re: ConnectionStrings
Posted: 02 Aug 06 9:32 AM
|
fiogf49gjkf0d no its not the ObjectDataSource as thats used for business objects.
I did manage to get this work, which was just slightly diffrent to my first effort.
<add name="SLXOLEDBConnection" connectionString="Provider=SLXOLEDB.1;Data Source=E1-webv623ersist Security Info=True;User ID=admin;Initial Catalog=E1-METIS;Location=127.0.0.1" providerName="System.Data.OleDb" />
|
|
|
|
Re: ConnectionStrings
Posted: 02 Aug 06 10:59 AM
|
fiogf49gjkf0d Sorry for chiming in late here. It looks like you've figured this out already, but the "providerName" refers to the .NET Data Provider to use, not the OLEDB provider name. For SLX, you'll always use the System.Data.OleDb data provider and then specify the SLX OLEDB Provider in the actual connection string. |
|
|
|
Re: ConnectionStrings
Posted: 02 Aug 06 11:02 AM
|
fiogf49gjkf0d Good that you got it working.
I havent used the SQLDATACONTROL anyway..... |
|
|
|
Re: ConnectionStrings
Posted: 02 Aug 06 11:07 AM
|
fiogf49gjkf0d Hi Nandu, you don't need to use the SQLDataSourse control, but as I'm using a FormView I do, and it seems you can only use ConectionStrings for this and not AppSetting Keys.
Thanks for you help -- Duncan |
|
|
|
Re: ConnectionStrings
Posted: 02 Aug 06 11:10 AM
|
fiogf49gjkf0d Thanks Ryan, the providerName was confusing as you need to set the SLX provider name in the connection string and then another OLEDB provider as the provider name.
I remember on a previous post or blog you wrote, you mention being able to impersonate a user in the connection string can you let me know how you do that?
Many Thanks -- Duncan |
|
|
|
Re: ConnectionStrings
Posted: 02 Aug 06 11:16 AM
|
fiogf49gjkf0d Originally posted by Duncan Cook
I remember on a previous post or blog you wrote, you mention being able to impersonate a user in the connection string can you let me know how you do that? |
|
Basically you just add a name-value pair to the extended properties (See http://www.slxdeveloper.com/page.aspx?action=viewarticle&articleid=55) If I wanted to impersonate the user "lee", I would simply add "impersonate=lee" in the extended properties of the connection string (Assuming "lee" is a valid SLX username). Then I get lee's security in all my queries etc, but I don't need to know lee's password (AFAIK you have to log in as admin to impersonate - meaning you supply admin's username & password in the connection string, but add the impersonate value in the extended properties) |
|
|
|
Re: ConnectionStrings
Posted: 02 Aug 06 11:39 AM
|
fiogf49gjkf0d yes, we cannot use the appsettings for this...I agree.Mine was taken from a vs2003 setup for slx .Sorry ! Now i understand that with 2005 things have changed!!
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Connection_String %>" SelectCommand="SELECT * FROM [Customers]"> </asp:SqlDataSource>
and this in your web.config files
<connectionStrings> <add name="Connection_String" connectionString="Data Source=localhost; DataSource=pubs; User ID=sa; Password=admin;" providerName="System.Data.SqlClient"></add> </connectionStrings>
I also happen to read something on these new controls
See this ...
http://www.theserverside.net/news/thread.tss?thread_id=29919 |
|
|
|
Re: ConnectionStrings
Posted: 02 Aug 06 11:40 AM
|
fiogf49gjkf0d Thanks Ryan, I knew I'd seen it somewhere.
So is there a way to append to my connection string. For example if I'm calling my app via url like so "../myapp.aspx?userid=lee" can I then use this to append to the connection string? |
|
|
|
Re: ConnectionStrings
Posted: 02 Aug 06 12:01 PM
|
fiogf49gjkf0d Nandu, this is an excellent article. For us there are two reasons to use ASP.NET, one its Richer and two it’s faster to write.
Using the SQLDataSource with a formView is the fastest way to build a detail view for adding/updating and deleting. Creating a well structured architecture which separates the User Interface from the Business Logic (For the application we are creating) wouldn't offer us anything in the short, medium or long term, so why do it? I think like most things you have to weigh it up on a case by case basis and not have a blanket approach to building applications.
|
|
|
|