btabusy.blogg.se

Website development with visual studio and sql server
Website development with visual studio and sql server











website development with visual studio and sql server

So, I tried the above SQL statement in the 'query builder' for the GridView and DetailsView. You may also want to set a debug breakpoint in your code and check out the value of the user name to verify it is correct. The resulting value will look like domainName\username.

website development with visual studio and sql server

To include the domain name in the query just remove the Split method. I'm not aware of any difference in the "Query Builder" between VB and C# You could specify a question mark instead of a variable but I don't know where you would specify the parameter value (if possible) at runtime. The SQL statement I provided was not designed to be used in the Query Builder since it involves variable substitution for the criteria. Like I said, the GUI stuff is fine until you have to dynamically change the results of the data source. At that point you have to understand how all the plumbing works. The final piece to the puzzle is usually another data source (DataSet) that you probably created with the DataSet designer. If it's a binding source then you can probably specify the Filter property in code in order to return only the rows the user is supposed to see. If you have been using the GUI tools, it's probably an intermediate binding source. The DataSource property will indicate which object it is using. It works through a DataSource, which can be any number of objects. The GridView does not operate directly with the database. Maybe someone has a better way of displaying data in a GridView or DetailsView depending on the user's name.

website development with visual studio and sql server

I used the Query 'Builder' in the GridView control and tried the following without success: Also I'm not sure how to ensure that the query is parameterized.

website development with visual studio and sql server

I tried everything from to LoginId to UserName. However, I don't know how the Login credentials are called. I assume I have to use a parameterized query with the parameter being the Windows Login credentials. My goal is it to display the data records in the GridView depending on the respective user's Windows login credentials, so that only specific records are being displayed. I dragged a GridView control from the toolbox menu and configured the Data Source so that the GridView displays ALL records from the SQL table. The website will be used in a local network and hence Windows authentication is being used. I'm building a basic ASP.NET 2.0 website that allows entering, editing and viewing records stored in a SQL DB table. I'm using Visual Studio 2005 Web Developer with a SQL DB.













Website development with visual studio and sql server