DataSource Controls :: How To Lockout Other Users While Accessing Database
Jun 1, 2010
I need to do an insert into a database table (SQL Server). I want to compute value of 1 column based on the existing data and then do an insert. How do I prevent another user from getting access to the database in the middle of this process?
View 2 Replies
Similar Messages:
Jul 2, 2010
I know this is a beginner question but I am struggling to find any clear tutorials etc on how I can create new records in a database table based on information added into text boxes on a page. Also what is the best way to do this LINQ, dynamic data website etc etc?
View 1 Replies
Sep 21, 2010
I made a website, 1 database; We have 4 cumputers, the 4 are using the same website and saving datas at the SAME TIME.
The problem that i have is that when 2 people click in the save button at the same time, only onces is in the database, but the others get lost.
Visual Studio 2010, Framework 3.5, MS-SQL 2008, C#.
The conecction is in c#, everthing is in c#.
View 1 Replies
Jan 13, 2010
I am attempting to write my very first ASP.NET application, it will simply display the contents of an SQL server database table in a Gridview. This is just a first step, my eventual intention is rewrite a set of VB6 applications I wrote some years ago. But I need to walk before I can run.
I have already created an SQL Server database containing all the tables used by the VB6 applications.
How do I link this database to my ASP.NET application. Previously (on another computer) I have simply opened "My Computer" and then navigated to the .mdf file (e.g. northwnd.mdf) and then dragged and dropped it into App_Data in Visual Studio. However when I try that on my own machine, with my own data, I get an "Access Denied" message.
How can I not have access to my own data on my own computer? What am doing wrong?
I am running Visual Studio 2008 on a Windows 7 Ultimate machine, with SQL Server 2005 Compact Edition (or which ever one installs with VS 2008).
View 13 Replies
Feb 11, 2010
I just created a component management system.. I would like to share files and folders among users from a database. Actually i couldn't do that.
View 1 Replies
Jan 6, 2010
I'm currectly tryin to access a specific value in my database in a specific column. I'm tryin to use the primary key of the table to access the actual value in the row of that ID.
The current code:
[Code]....
Just iterates through the table and looking for any row with the boolean 'checkin' value is True, then it takes the 'id' value of that row and stores it into an array. Is there a way that I can access a another entry, and only that entry, in the table with the 'id' stored in the array?
Like if my data base contained and int, primarykey, `id` value, a boolean, `checkedin` value, and a `time` value, is there a way to access, lets say, the row with `id` equalling 3 and and the checkIn value from that row?
View 2 Replies
Jun 25, 2010
different return for added users and for rejected users?
[Code]....
View 4 Replies
Jul 12, 2010
We have a few scenarios which mean users can see other users data if they're on the same machine.
Scenario 1
Login User A Browse to forms with perosnal data Logout User A Login User B Either hit back button until you reach User A's personal data or.. Use browser history to jump directly to user A's personal data.
Scenario 2
Login User A Browse to forms with personal data Close browser New Browser, Use history to go directly to User A's data.
The 2nd one was caused by the browser displaying the page from its cache, so for that one, I added the following to the web.config..
[Code]....
[Code]....
which seems to do the trick, but I need to know how to fix the first part and whether the web.config changes are all that's needed to clear any cache.
View 6 Replies
Jul 12, 2010
I have a web site with an administrative section. All administrative pages are stored in a directory called "db/administration". There is only one user that I want to have access to the pages in this directory. That user's username is "system". Currently, I am using the following approach in my web.config file:
[Code]....
When I logged in as another user, I was still able to access pages under db/administration when I navigated to them through the browser's address bar. What am I doing wrong?
View 2 Replies
Jul 23, 2012
How to Protect Web services from Un authenticated users.. right now Im Using Protected Access specifiers.. Is it Correct method To Protect Web services?
View 1 Replies
Jan 4, 2010
I've got a website and we just had a huge jump in traffic. Now all of the sudden we're getting sql parameter errors left and right. We switched to a new sql server a few weeks ago and everything has been fine but the added traffic seems to be breaking us.
I have a data access class that is called when each user trys to logon. It runs through several tasks before finally updating the users last login date and forwarding them to the administration section.
What I'm seeing from the trace logs suggests that when I'm logging in the first several tasks are using my data (lets say user=birk pass=word). But at some point the accessor class starts sending over the data from someone else who's trying to login (lets say user=abcxyz)
Every connection we make to the server is closed when we're finished with it. I'm nulling out all of the accessor objects when I'm finished with them. But somehow different user data from different sessions are making their way into other peoples instances of the object.
I'm not using session/application/cache/viewstate to store the objects so I'm not really seeing how they could edit eachother... Its just really weird and I'm not sure how to even go about researching the problem.
This is roughly the accessor class... I trimmed out some of the parts that weren't reliant to the issue
[Code]....
View 3 Replies
Sep 14, 2010
I have designed a navigation structure that is customisable from within my application and linked to the users role.
So I can restrict what menu items a user gets based on their role.
I have managed to do this quite well using SQL Tables and an ASP.Net Menu.
I can get it to only show the menuitems that are marked active and I have created an Stored procedure to get the menu items for a particular role.
Where I am struggling is getting the Logged On Users Roleid to pass it to the Stored Procedure.
I can get it using a regular aspx page but my menu is on my masterpage and I do not want to have to code it in each and every page.
I even tried to do it with a user-control but same happens. It seems that the User class is just not available when in a masterpage.
how I can pass the roleid from a Class or something or from the page to the masterpage?
View 2 Replies
Feb 21, 2010
I have a page called Article.aspx that takes content from the database. I would like to use the title of the content as the title of the page for a little SEO I am doing. I setup a literal on the aspx page that must take the value of the content title from the code behind, what is the best way about doing this? I'm guessing I need to open a data base connection to read the record from the table but I am still learning asp.net and not sure how to write it
View 22 Replies
Feb 14, 2010
I have a webpage that uses a formview. The formview gets the data from the objectdatasource which connects to a query in a table adapter.
I wanted to add a hyperlink in the page right below the formview that will "hyperlink" to another page passing parameters. Those parameters are values from the formview.
Can I just access the parameters of objectdatasource from outside the formview as follows?(it isn't working)?:
<asp:HyperLink
ID="HyperLink215"
NavigateUrl='<%# Eval("VIN", "Contact.aspx?Subject={0}") %>'
runat="server">Contact Us Regarding This Vehicle</asp:HyperLink>
If not, can I access those parameters in codebehind and do a redirect from there? How do I access the data of objectdatasource from codebehind? If I can do that, I could just put a button. Then in the button's click even, I could do the redirect.
View 4 Replies
Dec 14, 2010
i am still relatively new to web development and have been encountering some issues when multiple users click a button at the same time.
i was wondering what could be causing this as i have already removed all static variables realiseing that was a mistake and replaced them with viewstates were needed then sessions when moving across pages
View 7 Replies
Jul 21, 2010
I have an ASP.Net 4.0 web application which very frequently loads data from the database and does heavy calculations on it. I want to cache this loaded and prepared data in a central cache that can be accessed by every user and computer who uses the application.
Simple use-case:
User 1 accesses webpage, cache is empty, data is loaded/calculated, data is cached
User 2 accesses webpage, cache contains data, data loaded from cache
User 3 accesses webpage, cache contains data, data loaded from cache
User 1 reloads webpage, cache contains data, data loaded from cache
Cache expires
User 3 refreshes webpage, cache is empty, data is loaded/calculated, data is cached
I know that ASP.Net has a built-in cache mechanism. What I don't know is whether it can be shared between different users accessing the site on different computer at the same time. I would also like to know how the system behaves in a web farm environment.
View 3 Replies
Jun 2, 2012
i have create web application for school management system...bt when i run my webside...(my welcome page is defaul.aspx bt if i want to acces studentdetail.aspx then i only enter url and i get studentdetail.aspx)
View 1 Replies
Feb 4, 2011
I have a single column returning SQL data source and I want to use the data for a simple if statement, but for the live of me I can't figure out how to do it. *oh for the old days, I wrote the same thing in simple asp in about 45 seconds*
[code]....
For the life of me I can't figure out how to get that data into a variable or any way to access it. I know its probably simple. I have tried functions, etc off the net but everything I try results in another error.
View 6 Replies
Jun 6, 2010
I have a gridview control that displays expenses claims received from clients. I have a template field that contains a checkbox - if this is ticked, a value from the gridview is added to a variable and this is outputted to a label control.
What I then want to do is to update the database according to which row has been ticked. I have so far the following code that adds each value to an array, which I was then hoping to access in the sql query i.e. Update table set value = value where id = (id's added to array)..
Code as follows - so far I'm just displaying the count of values in the array to make sure they are actually being added:
[Code]....
View 8 Replies
Apr 23, 2010
As the title sugests, I am missing a (basic?) concept as I teach myself asp.net, linq, and C#. It has been awhile since I've done anything object oriented, so I don't know how much that is impacting this gap in my understanding. Anyhow, here is what I am trying to do. I have three SQL Server tables: PERSON, POSITION, AREA. There is a 1 to many relationship between PERSON and POSITION, and a 1 to 1 relationship between POSITION and AREA. Given the following code I verify who the person is who has logged into the browser:
[Code]....
I want to be able to return all of the AREAs the person is able to access, based on the position they currently hold. I am able to easily do this in a SQL Server query, and I am sure I can do this with a SQL stored procedure once I pass the EMPLOYEE_ID to the procedure. However, I would rather do this in the page_load event, and load the returned results into gridview1 for the viewer. The issue I am running into is in building the LINQ query. When I try to build it, I can only get access to two of the three tables, depending on which table I select with db. Is it possible to access all three tables in the same query?
View 10 Replies
Jul 27, 2010
I'm programming a webpage in ASP.NET which displays a list of students not listed as participants in something, and upon clicking a student name shows you a brief summary of their details, so the user can ensure they're selecting the right person. Each student is identified by a unique ID.
My code currently correctly obtains their ID, adds it as a parameter to my stored procedure and executes the procedure;
[Code]....
However, when I try to access the results, with say dv.Table.Rows[0], I get the following error:
[Code]....
Upon debugging, there don't seem to be any results returned... when running just the stored procedure in SQL Server with the same data, it does return a single row, as expected.
View 2 Replies
Mar 19, 2010
I am new to using ADOMD for accessing SSAS cubes. I am having an issue with concurrency. I am using ADOMD to connect to SSAS 2005 in an ASP.Net 2008 application. When a user executes an MDX query and the ASP.net page opens an ADOMD connection, a second user that tries to execute an MDX query gets "a connection is already open" error. I don't understand how ADOMD works. Does it open only one connection for all users because ASP.Net is using a single account for all connections from the web server? I do not have this problem when using ADO.net in the same manner.
View 2 Replies
Aug 25, 2010
I have a datalist and I am filling it using a dataadapter, dataset. So in my .ascx page, I have
<asp:datalist runat="server" id="dlProducts" repeatcolumns="2" repeatdirection="horizontal">
<itemtemplate>
<table border="0">
<tr><td><%# Eval("Item_Name") %></td></tr>
<tr><td>I have to add a picture here</td><td><%# Eval("First_Name") %></td></tr>
</table>
</itemtemplate>
</asp:datalist>
In the area where I have put a statement like "I have to add a picture here", I have write a big case statement. Like:
Case: 6 // show a picture from file1
case: 7 // show a picture from file2
Case 8: //show a picture from file3
So How do I do this here? Because I dont know how to access the datalist values from code behind.
Here is my code behind:
SQLString = "SELECT First_Name, Picture, item_name, item_id from table1 where item_id = " + request.querystring["iid"];
dataadapter daItems = new dataadapter(SQLString, "connection_name");
dataset dsItems = new dataset();
daItems.fill(dsItems);
dlProducts.datasource = dsItems();
//So at this point how do I populate the picture in the <TD> tag I mentioned earlier?
View 2 Replies
Feb 1, 2010
I am using a list of objects as a datasource and passing the object into a user control. I use the code outlined below
[code]...
When I try to access the object this way, it's null.
Funny thing, I can access the user control and all the control data in the user control, but the object (both in the gridview and passed to the user control) are null.
View 1 Replies
Jan 15, 2010
I'm developing an ASP.NET user control in VS2008 that writes to a SQL Server 2005 database. I've published the control to a SharePoint 2007 MOSS page using the SmartPart addon. The control consists of a few text fields and a submit button that writes the contents of the text fields to the database. When I test the control in the Visual Studio debugger, it works fine. When I try to submit data from the SharePoint page, I get the error shown at the end of this post. Last time I saw this, it was a database permissions error, but I've granted my site's default application pool read/write access to my database. Does anyone have any idea what else the problem might be? Also, how can I double-check the credentials that the SharePoint page is using to access the database, since I still suspect that this is a permissions issue?
[ERROR TEXT FOLLOWS]
Server Error in '/' Application.
Object reference not set to an instance of an object.
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.NullReferenceException: Object reference not set to an instance of an object.
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:
[NullReferenceException: Object reference not set to an instance of an object.]
ConnectionHandler.ClientDataConnect() +103
ClientData.ClientData.Page_Load(Object sender, EventArgs e) +1426
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +24
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +41
System.Web.UI.Control.OnLoad(EventArgs e) +131
System.Web.UI.Control.LoadRecursive() +65
System.Web.UI.Control.LoadRecursive() +190
System.Web.UI.Control.LoadRecursive() +190
System.Web.UI.Control.LoadRecursive() +190
System.Web.UI.Control.LoadRecursive() +190
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2427
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
View 2 Replies