How To Propagate User Identity Form Application Server To Database

Apr 21, 2008

Hi All,

I am new to MS SQL SERVER 2005.
My web application using SQL Server 2005 as back end database to store all the information.
I am using connection pooling to get connection form db.
But my fron end user( user who logged in into webapplication) lost his identity b'coz for database user is application server.
Now I wanna to track front end user in db.

In oracle I can do it by using CLIENT_IDENTIFIER. But in sql server I don't know how to do it.

in oracle i can do it as below
public void setIdentity(Connection conn, String identity) {
PreparedStatement ps;
try {
ps =
conn.prepareCall("begin dbms_session.set_identifier(?); end;");
ps.setString(1, identity);
ps.execute();
ps.close();
} catch (SQLException e) {
// Handle the exception
}
}
<!--[if !supportLineBreakNewLine]-->
once the transaction is complete, the application should reset the identity as follows:

public void clearIdentity(Connection conn) {
PreparedStatement ps;
try {
ps = conn.prepareCall("begin dbms_session.clear_identifier(); end;");
ps.execute();
ps.close();
} catch (SQLException e) {
// Handle the exception
}
}
<!--[if !supportLineBreakNewLine]-->
Please guide me for same.

Thanx in advance.

Bhadu<!--[endif]-->

View 6 Replies


ADVERTISEMENT

HttpContext.Current.User.Identity.Name Form SQLDataSource

Apr 21, 2007

Hi,How do I get hold of the HttpContext.Current.User.Identity.Name from within an sqldatasource? I want to create a WHERE clause that says WHERE UserName = @UserName and the @UserName parameter be filled with the current user name. I would be able to do this in code, but I don't know how to get at this information from within a datasource. At a guess I tried to use the Cookie option from the drop down list, and use the name of the FormsAuthentication Cookie, but this didn't work. Is there a way I can do this? If so how? I don't want to resort to using a hidden field or anything like that if I can help it. Many thanks, Steve 

View 2 Replies View Related

4 Layered Web Application For Inserting Data Into A Database Using Sql Server As The Back End And A Web Form As The Front End Using C#

Dec 10, 2005

4 Layered Web Application for Inserting data into a database using sql server as the back end and a web form as the front end using C# .
Can someone provide with code as I am new to this architecture and framework.
Better send email.
Thanks In Advance,
A New Bie

View 1 Replies View Related

Failed To Generate A User Instance Of SQL Server Due To Failure In Retrieving The User's Local Application Data Path. Please Make Sure The User Has A Local User Profile On The Computer. The Connection Will Be Closed

Dec 7, 2006

This is my first time to deploy an asp.net2 web site. Everything is working fine on my local computer but when i published the web site on a remote computer i get the error "Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed" (only in pages that try to access the database)
Help pleaseee

View 3 Replies View Related

SQL Server 2005 Triggers And .NET Web Form Application

Jan 17, 2008

Hi,

Where do I ask questions about creating SQL Server 2005 triggers? I want to create a field in a SQl server 2005 database based on a combination of four (4) fields in one table, and then have the data updated in a field in the same table, as well as output to the asp.net web form.

Any guidance appreciated.

Thanks.

View 4 Replies View Related

How To Deploy SQL Server Everywhere With My Windows Form Application?

Jul 25, 2006

Hello!

I've been creating a vb.net 2005 windows form application using Everywhere and it has been going pretty well. However, I haven't had much luck finding any help on how to deploy my Everywhere database file(s) and Everywhere itself. To install redistribute Everywhere, can I just add the the 8 .dlls found in the Everywhere directory into my VS setup project? Also, what database file(s) do I need to deploy in my windows setup?

Thanks!

View 4 Replies View Related

Using User Defined Data Type (UDT) In A Sql Server 2005 Database + Window Application.

Feb 18, 2006

Hi,

I am using VS2005 C# + sql server 2005 Express edition.

I need to using a database that uses my own defined data types to define its tables columns.

I already have designed a Database projact and create the new UDT as follows:



Create a new Database project in the Visual C# language nodes.


Add a reference to the SQL Server 2005 database that will contain the UDT.


Add a User-Defined Type class.


Write code to implement the UDT.


Select Deploy from the Build menu.

Now I need to ask some quistions:

1- When I try to add a new query to a table that contains my new data type in its columns,if I try to exexute the query the next message appears:

'Execution of user code in the .Net framework is disabled. Enable "clr enabled" configuration option'.

How can I doing that??

2- I need to use that database - which has the new data type - in a traditional ' Visual C# Windows Application' instead of 'Database', but:

when I try to add a new Data Source that contains the tables that have the new data types in its definitions, the next message appears:

'<AyaDatabase.dbo.MyNewUDTTable>

User-defined types(UDTs)are not supported in the Dataset Designer.'

So, how can I resolve that problem??

please help me.

Thanks in advance for any help.

Aya.



View 4 Replies View Related

Where To Order The Table Values Displayed In A Web Form Object? In Sql Server Or In The Application?

Sep 10, 2004

Hi,

I have a table in my database with several car types, and the order I want for that table is:

Car_typeA_1
Car_typeA_2
Car_typeA_3
Car_typeA_4
Other_Cars_typeA
Car_typeB_1
Car_typeB_2
Car_typeB_3
Other_Cars_typeB
Car_typeC_1
Car_typeC_2
Car_typeC_3
Car_typeC_4
Car_typeC_5
Other_Cars_typeC
...


This table is more or less always the same, but from time to time I want to add a new car type, for instance; Car_typeA_5, but this new type must be located under the last register, in the example under ‘Other_Cars_typeC’. So, now the order is wrong, and when I want to display these car types to a web form object, the items will appear wrong ordered.

My question is: To order the values(items) correctly, Where I have to do it? In the web page (ASP.NET) code behind, or somewhere in SQL Server (for example in the Stored Procedure that passes the value to the application)? Or maybe in the same database table..?

Thank you,
Cesar

View 7 Replies View Related

Please Help *** Failed To Generate A User Instance Of SQL Server Due To Failure In Retrieving The User's Local Application Data Path

Apr 28, 2008

Hi all hope some one can help - please bear with me new to this
Basically I have had to change pc's so I copied and pasted my ASPNET.MDF and LDF from my old pc to new PC including webpages/apps etc.. created.
However now all I get is "Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path """"
Just don't understand what permissions the db should have, does it need to match the SQL Express owner...
 
any help would be most appreciated
 
Thanks
 
Chris 
 
 

View 5 Replies View Related

Failed To Generate A User Instance Of SQL Server Due To Failure In Retrieving The User's Local Application Data Path

Jun 21, 2005

I installed my asp.net 2.0 web application  and sql express june editon on my windows 2003 server.When the application tries to reach the database i am getting the following error"Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed."I can understand that it has something to do with user right but more than that I am pretty lost. Can anyone translate this error for me and give me some tips on what do to.I checked first the user running the sql express service and saw it was the NETWORK SERVICE user. I changed it to be the local system account but that did not make any difference. The application is running just fine on my local computer(Win XP sp2). This one has SQL express April edition though.

View 3 Replies View Related

Edited Data Won't Propagate Back To The Database (VB 2005 Express &&amp; SQL Server 2005 Express)

Dec 11, 2006



Hi,

I'm trying to learn some VB programming with the VB 2005 Express Absolute Beginner Series video tutorials (which I think is great) and have come across a problem that I can't solve.

When I follow the instructions in Lesson 9 (Databinding Data to User Interface Controls) my application will display the data from the database correctly and I can edit it (and as long as the debugger is running the data remains changed). However, the changes won't propagate back to the database. I don't get any error messages but after I edit the data, save (with the save button on the BindingNavigator toolbar), and end debugging the data in my database remains unchanged. When I use a MessageBox to show how many rows where edited/updated in the

Me.myTableTableAdapter.Update(Me.myDatabaseDataSet.myTable)

I get the correct number back. I'm sure the problem is not due to coding errors since I've also tried running the accompanying Lesson 9 project file that can be downloaded from MSDN and the problem persists.

I'm using Windows XP SP2, SQL Server 2005 Express Edition and VB 2005 Express Edition. I've tried installing SQL Server 2005 Express with a number of different settings, including default settings, but it doesn't make any difference.

Would greatly appreciate any feedback on this as I'm keen to resolve this problem so I can get on with the next tutorial lesson.

Thanks,
Ieyasu

View 6 Replies View Related

Does A User Have To Have SQL Server Installed In Order For Windows Form To Connect To SQL 2005 Express DB

Apr 23, 2008

Hello,

I am creating a windows application that is not going to be used in a controlled environment like a LAN or some other network, so I want to include a local database in the install of this app. Ideally, I would like to use SQL 2005 Express like you would MSDE or Access, but I am not sure if the user must have SQL Server installed on their machine in order for this to work and I don't have a machine without it to test on.

Any help on this is greatly appreciated.

Thanks,
Derek

View 1 Replies View Related

How To Re-Structure Form After Adding An Identity

Apr 25, 2007

I'd created a dataform from a table stored in a SQL database, after that I changed the primary key field to be an identity, refreshed the dataset but when I execute the program, it raises an exception when I try to save the record after adding a new one asking me for the value of this field. What can I do to be sure it will be created automatically?

View 4 Replies View Related

Concurrency Issue On A Single Database User For An Online Read/write Application

Aug 3, 2006

Hi to all DBAs,

I would like to ask if there will be a write and concurrency issue if i would create an online application with just one user connecting to the database, just like most open source php/mysql that can be downloaded

i.e
Setup 1. I will grant a single user that will connect to a database and will be set to a config.inc.php file and then create a table users (userid, username, password) and this table will be used for the application authentication and access control.

Setup 2. or is it much better to grant users that will connect to the database and have the table users for access control of the application?

to further illustrate my query:

Setup 1 would be:
###################Table: Users
user a@ipadd --> db1 --> userid mary --> myOnlineApp
user a@ipadd --> db1 --> userid john --> myOnlineApp
user a@ipadd --> db1 --> userid paul --> myOnlineApp


and Setup 2 would be:
#####################Table: Users
user mary@ipadd --> db1 --> userid mary --> myOnlineApp
user john@ipadd --> db1 --> userid john --> myOnlineApp
user paul@ipadd --> db1 --> userid paul --> myOnlineApp

will Setup 1 be enough if I will use SQL Server as database?

or Setup 2 is better user/database architecture?

This application will be online enrollment for a school with 16,000 students

very much appreciated for the feedbacks and suggestions

^_^x

View 3 Replies View Related

Remote Access For Windows Form Application

Jan 10, 2007

I have a windows based software application that connects remotely to a sql server 2005 and calls stored procedures. There is someone that I work with that is cautioning the company strongly that this is a bad thing to do in terms of security. Isn't this a very common thing to do? Assuming that the SQL Server installation is setup appropriately. Is this a bad practice?

View 4 Replies View Related

Checking Last User Identity On Remote Server

Oct 12, 2006

Is it possible to get the latest inserted Identity value on a remote server?

(The following gives a NULL result:

select ident_current('[my_linked_server].thedatabase.dbo.thetable')

)

View 4 Replies View Related

Server Error In Application. Problem When User Name Has An Apostrophe In Name.

May 16, 2006

This is my code and all works great except when there is an apostriphe in the logon name. 
Example:  MRPJUser ( works greate )
Example: MRPJ'User (I get the server error at the bottom) 
Is there an Imports statement that would fix this, or where is my code failing, and what do I need to do to fix it?
 
 
<Code>
Imports System.Web.Security

Imports System.Security.Principal
Imports System.Threading
' Imports System.Net.Dns
Public Class LogIn
Inherits System.Web.UI.Page
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim hostName As String = Request.ServerVariables("REMOTE_HOST")
txtIPAddress.Text = hostName
Session("ComputerIP") = txtIPAddress.Text
txtUserName.Text = HttpContext.Current.User.Identity.Name()
Session("UserName") = Trim(txtUserName.Text)
TextBox1.Text = Trim(Session("UserName"))
LoadPage()
End Sub
</Code>
 
 
 
Server Error in '/ITWorkOrder' Application.



Line 1: Incorrect syntax near 'Test'. Unclosed quotation mark before the character string ' '.
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.Data.SqlClient.SqlException: Line 1: Incorrect syntax near 'Test'. Unclosed quotation mark before the character string ' '.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.
Stack Trace:




 [SqlException: Line 1: Incorrect syntax near 'Test'.Unclosed quotation mark before the character string ' '.]   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +742   System.Data.SqlClient.SqlCommand.ExecuteReader() +42   ITWorkOrder.LogIn.LoadPage() in C:InetpubwwwrootITWorkOrderLogIn.aspx.vb:163   ITWorkOrder.LogIn.Page_Load(Object sender, EventArgs e) in C:InetpubwwwrootITWorkOrderLogIn.aspx.vb:156   System.Web.UI.Control.OnLoad(EventArgs e) +67   System.Web.UI.Control.LoadRecursive() +35   System.Web.UI.Page.ProcessRequestMain() +750
 

View 1 Replies View Related

How To Set My ASP.NET Application To Access SQL Server 2005 Using Client's User Credentials?

Jan 29, 2007

Hi guys,I'm not sure if I'm just bad at googling but I can't seem to find a way to set an ASP.NET 2.0 web application to connect to SQL Server 2005 using the current client's user credentials. My web application is using Integrated Windows Authentication so its Page.User.Identity is set to a DOMAINusername value... I want to pass that to my connectionstring or have my connections pick up the identity automatically and use that Identity when accessing the db server.Oh and another thing, my IIS Application Pool is using a specific Identity itself, so I don't know if that might affect the above.Hope someone could help. 

View 2 Replies View Related

SQL Server 2012 :: Query For User Access To Application Modules

Mar 24, 2015

I have to create a query that will be returning the users and the application modules they have access for. Along with the list of users and modules the query should also return if any module is not accessible for that user.

The 'ApplicationUsers' table is like this:

CREATE TABLE #ApplicationUsers
(
userId INT,
UserName VARCHAR(50)
)
INSERT INTO #ApplicationUsers VALUES
(1, 'Daniel'), (2,'Martin'), (3, 'Brandon'), (4, 'Doug')The 'ApplicationModule' table is like this:

[Code] .....

I used pivot query but there are a couple of limitations in it(may be I am making mistakes in it). First, the pivot columns are static whereas I need dynamic column names(Application Modules). Second, I need to include all the users with all the modules with access or without access that I am unable to achieve.

View 5 Replies View Related

Installing Onto Windows 2003 Server For Multi-user Application

Apr 22, 2006

Good Day,

I have an application that is being developed on Visual Studio 2005 (VB) and SQL Express. The application is set up to use the SQL Express on the development computer, and if an Internet or CD install is built, it installs SQL Express as expected. The question is, when it is time to deploy and put the SQL Express database on the 2003 server, how should the install on the server be done and how should we set the database path to the server?

Thanks,

Dave

View 1 Replies View Related

Transfering Data From A Web Form Into Sql Server Database

Sep 20, 2005

Hi I am trying to develop a web based application. I am trying to insert data from my web form into sql server database using stored procedures. I am having a problem while i try to exceute the command. The error given by system is System.InvalidCastException: Object must implement IConvertible. at System.Data.SqlClient.SqlCommand.ExecuteNonQueryany suggestion what am i missing?With Regards,Sameer Jindal

View 2 Replies View Related

How To Code Login Form With A Sql Server Database?

Feb 29, 2008

hello..


i have created a vb.net application.
i have a database (sql server 2005)with user and password which are salted.
I want to use the login form of vb.net to login in to the application.(how to code the comparision string?)
the username and password will be put in text boxes.(how to form the connection to the sql database?)
how to do the coding for this?? plz help..

plz show me if there are simple methods to this.

regards
Savio.

View 1 Replies View Related

Login Failed For User 'NT AUTHORITYANONYMOUS LOGON' (but User.identity.name Is Correct)

May 1, 2007

I need help.  The security principal is the correct DomainUser, but the error message says I am not authenticated.
So here is my error Message:
Login failed for user 'NT AUTHORITYANONYMOUS LOGON'. Me.User.Identity.Name=CompanyDomainRyan; System.Security.Principal.WindowsIdentity.GetCurrent=CompanyDomainRyan; HttpContext.Current.User.Identity.Name=CompanyRyan
Generated by:
Dim secPrinc As System.Security.Principal.WindowsIdentity = System.Security.Principal.WindowsIdentity.GetCurrent
Me.lblError.Text = ex.Message & vbCrLf & vbCrLf & "Me.User.Identity.Name=" & Me.User.Identity.Name & "; System.Security.Principal.WindowsIdentity.GetCurrent=" & secPrinc.Name & "; HttpContext.Current.User.Identity.Name=" & HttpContext.Current.User.Identity.Name
Here is the Connection String:
Private ConnString As String = "Server=10.144.162.111;Database=DNS;Trusted_Connection=True"
 
IIS has 4 websites hosted on it.  The parent level allows anonymous with windows auth off, but the website level has anonymous off with widnows auth and digest.
In IIS, is there a problem with having the parent level anonymous and website level windows auth?

View 1 Replies View Related

Create User Form

Oct 7, 2007

hello there,

Can i create user forms for user to select options and then present them with data based on their selection.i want to be able to use check boxs and combo box.thanks in advance

cheers
zolf

View 1 Replies View Related

Create User Form

Oct 7, 2007

hello there,

Can i create user forms for user to select options and then present them with data based on their selection.i want to be able to use check boxs and combo box.thanks in advance

cheers
zolf

View 5 Replies View Related

Identity Sql Servers On A Web Application - How

Mar 14, 2007

Hi, What I want to do is simple to explain, hard to obtain (i guess): I want to fill a dropdownlist with the names of the sqlservers detected on the system. I´ve installed a sw recently that prompts for that, and when you select that server, then it prompts you to insert username and password, and then appears a dropdownlist again with the names of the databases of that sqlserver. Is this possible to do, at least fill dropdownlists with sqlservers and database names?!?I don't see how, thanks! 

View 6 Replies View Related

Create Vb.net User Login Form

Jul 19, 2006

Hi all,

I made a Windows forms app using vb.net (VS2005) and SQL server 2005 Express Edition (to which I'm new). During the creation of the app I used windows authentication in the connection string. Now I want to secure the app, meaning I want the SQL Server database not to be accessed without a username/password. I guess the logical thing is to create a login form, providing the username and password so it can be used for connecting to the database. I thought this would be a standard (thus easy) thing to do, but no forum or article yet showed me a way to accomplish this in an understandable way. I also want to deploy this app using click once technology. I need to distribute this app on a cd/dvd.

If possible, can anyone give me a step by step scenario for this? Many thanks in advance

(ps: please let me know if this should be in another thread)

View 7 Replies View Related

SQL Server Admin 2014 :: How To Position 5 Database Server For Centralized Database For Application

Jun 3, 2014

1) We are providing a e governance solution for an organization,where we are providing a centralized database,Client have provided 5 Database server for the same.how can we position the Database Server? there are 5000 Concurrent users and 25000 users,SAN Storage for approx. 60 TB,Database size of 2 TB and growth of 1 TB every year

2) How many instance can we have for above said Case?

3) How much RAM Required ?

View 0 Replies View Related

Problem About Application Pool Identity

May 15, 2008

Hi all,

If I want to install Reporting Service for SharePoint Integrated Mode. What is account that I choose to configuration?
Such as, SharePoint admin account or New Domain Account or New Local Accout.

Please, help me. Because I try to install Reporting service all the time, but I cannot still access ReportServer Virtual Directory.

Sometime error.

The report server has encountered a configuration error. See the report server log files for more information. (rsServerConfigurationError)

or

HTTP Error 401.1 - Unauthorized: Access is denied due to invalid credentials.

......

And I want to know about, what is authentication mode of ReportServer Virtual Directory?


Thank you very much again.

View 1 Replies View Related

Events Keep Bubbling Up, Even With Propagate=False

Jul 28, 2006

I've been pulling my hair out for the last couple of weeks trying to make my SSIS package more robust. I'm running SQL 05 SP1 on Windows XP SP2. Right now when there's a failure, the error propagates all the way up and my package stops running. Clearly not very robust. I have a heartbeat portion that makes a connection to the database every couple of minutes. Sometimes it loses the connection in the middle of the night, probably due to some maintenance going on. I have created an event handler to log the error, sleep a couple of minutes and set Propagate=False. This works great. When the connection is down, the error is logged, once the connection comes back, the package just keeps going.
I also have an FTP component that receives a file and then needs to send back a handshake file. I tried the same method here, but the event keeps propagating up. I created an event handler for the Send FTP task itself, so that in case the remote FTP server isn't responding, it will error out. The Event Handler code is called and I verified that the value in Propagate is indeed False. And yet the event keeps propagating up and kills the whole package. FailPackageonFailure is set to False, FaileParentonFailure is set to False also.
Any idea what I'm doing wrong? Or is this a bug? Is there a work around?
Any help would be greatly appreciated.

View 15 Replies View Related

Depending On The Selection Of The User Of The Asp.net Web-form How Can I Do Changes In The Stored Procedure

May 11, 2007

Hi frdz,  I have created the following stored procedure in sql server 2005. In my database i have one option for the payment mode which can be done thru cash or credit(cheque).   I have created my web-application in asp.net with C# 2005. There i have a dropdownlist box for the user to select the option whether wants to do the payment thru cash or cheque.Depending on that selection if user selects cheque then all the reqt for cheque like it's no,dt,bankname etc...are visible.but if user selects the option as cash then the cheque details become invisible.Depending on the selection of the user of the asp.net web-form how can i do changes in the stored procedure...   i can write the condition likeif paymentmode=cash then ..........else.............but where and how can it be written ...pls tell methanxs in adv...u can go thru my below SP     ALTER PROCEDURE MiscellaneousStoredProcedure


@miscid int output,
@storename varchar(20),--store name to storeid
@accountname varchar(20),
@groupname varchar(20),
@paymentdt datetime,
@payeename varchar(30),
@paymode varchar(20),
@bankname varchar(50),
@chqdt datetime,
@chqno varchar(20),
@amt numeric(10, 2),
@bal numeric(10, 2),
@remarks varchar(50)

as

declare

@storeid int,
@accountid int,
@groupid int



begin
set nocount on
select @miscid = isnull(max(@miscid),0) + 1 from miscellaneourpay

if exists (select * from storemaster where storename = @storename)
select @storeid = storeid from storemaster where storename = @storename

if exists (select * from accountmaster where accountname =@accountname)
select @accountid = accountid from accountmaster where accountname =@accountname

if exists (select * from accountgroupmaster where groupname=@groupname)
select @groupid=groupid from accountgroupmaster where groupname=@groupname




begin transaction
insert into miscellaneourpay
(
miscid,
storeid,
accountid,
groupid,
paymentdt,
paymode,
payeename,
bankname,
chqdt,
chqno,
amt,
bal,
remarks

)
values
(

@miscid,
@storeid,
@accountid,
@groupid,
@paymentdt,
@paymode,
@payeename,
@bankname,
@chqdt,
@chqno,
@amt,
@bal,
@remarks

)
commit transaction

end 

View 2 Replies View Related

Can I Use The ReportingService2005.SetPolicies Method To Set The User Of The Form Authentication To The Role?

Oct 5, 2007



Hi,

Can I use the ReportingService2005.SetPolicies method to set the user of the form authentication to the role?

I mean the user name doesn't exist in the reporting service own table, only store in the our web system.


Thanks a lot

koukai

View 1 Replies View Related

How Do I Propagate Custom Properties To Downstream Transforms In A Data Flow Task

May 15, 2006

I implemented a custom source adaptor. I want to be able to associate custom properties with each of the output columns. I want them to be passed downsteam. The idea is to be able to retrieve these information in a downstream custom transformations of ours and process the various columns accordingly. How do I go about doing this?I noticed that the IDTSCustomProperty90 seems to have a local scope only.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved