.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

How to determine why e.AffectedRows = 0?

Posted By:      Posted Date: October 18, 2010    Points: 0   Category :ASP.Net
 

I'm trying to update a record in a Gridview and I keep getting an optimistic concurrency error... but the site is still in development, so another user cannot be updating the same record.

It's a simple two-column table (only 8 rows so far) - I removed the primary key and thought that might help clear-up the issue I'm having with trying to update that field, but it didn't help.

Can anyone tell me how I can see more information about why the e.AffectedRows is returning zero? I have a feeling that it may be a permissions issue... because it always seems to be a permissions issue.

I had something like this on another project, but it only errored in my development environment and worked perfectly in the production environment. I seem to lose file permissions occasionally after I back-up a site in my development environment.




View Complete Post


More Related Resource Links

Determine whether Forms Server is installed on a server

  
Check whether the Microsoft.Office.InfoPath.Server.dll and FormServer.aspx files are installed on the server.

Image processing, determine white space and crop

  

Hi,


I have created a image upload for our ID card system to allow users to upload new images, edit them and submit for approval.  This is all working well with a combination of asp.net (c#) and jquery to give a seemless editor etc.

We have had a few users who I cannot believe have scanned a photo of themself and then just submitted it with the A4 page of white and little photo.


I am wondering if anyone can help with a suggestion on how I could possibly reduce the load of these coming through (I can't believe they can be this stupid), it stipulates UK passport standards.


Would my only option be to check for a single continues colour that occurs and if it reaches a certain percentage point say 60% then to just send back an error stating they need to crop the image.

Can anyone help with providing sample or that I can use to move this one on.


I am still in disbelief on this one.  the other one is they take a photo of whole body and other in it and cut straight down middle chopping the people out but supplying a photo that no use for an id photo card....but that I can't imagine being solved programatically as I need to determine where their face dimensions are and what percentage of the actual photo is taken up by it and if it below a threshold reject it.




determine the best way to refresh a gridview when textchanged event occurs

  

Good afternoon.

I have the following gridview inside an updatepanel that makes the bind from a datatable:

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Button ID="ButtonAdd" runat="server" OnClick="ButtonAdd_Click" Text="Novo Artigo" />
                <asp:GridView ID="Dados" runat="server" AutoGenerateColumns="False" 
                    CssClass="Grid" Width="100%" CellPadding="4" ForeColor="#333333" 
                    GridLines="None">
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    <Columns>
                    <asp:TemplateField>
                    <ItemTemplate>
                        <asp:Button ID="AbrirModal" runat="server" Text="->" /> 
                                <asp:PopupControlExtender ID="PopupControlExtender1" runat="server"
                                TargetControlID="AbrirModal"
                                PopupControlID="PanelArtigos"
                                >
                                &l

determine the screen height within javascript and set a property on an iframe

  

I have a webform  that has a header and iframe,  what I need to do is on load detemine the users screen height and then  set the height on the iframe. Can someone explain  or show me an example of how to do this.


Thanks in advance.


How to determine if current SQL User is admin or owner?

  
I wish to determine, from my C# application, if the current user has admin or owner rights to the database they are connected to. I beleive I have all the information required: Servername Database name Windows/Database auth username (If database auth) password (if database auth) I'm trying to find a way that using the smo objects (smo.user), but as of yet I cant quite work it out: - How to get the appropriate user - How to determine if that user is an admin/owner. Any tips would be appreciated. If I have posted to the wrong forum, let me know - I couldnt find one that was obviously more appropriate. Thanks.

How to determine when the cube refresh has completed?

  
I'm trying run code after a cube refresh is completed, but I can't seem to figure out how to write code to determine when the cube refresh has been completed. If it were a simple calculation, I could use the code below to determine the "calculation state", but there doesn't seem to be "refresh state" that I'm aware of. Any help will be GREATLY appreciated!! Application.CalculationState = xlDone

AttachedPropertiesService determine if property already added

  
Hi, Is there any way to tell whether a property has previously been added to the AttachedPropertiesService, other than keeping track oneself in some external data structure ?  Thanks, Notre

How do I determine null with ADO reader?

  
I am using ADO reader to read rows in a table with matching values in two columns.  But when the reader has rows and one of the columns in a row is null instead of a long number, I get an error when I attempt to access the value.  In C# language, I have a statement that says "if (reader["Example"] != null) ExampleID = (long)reader["Example"];".  Unfortunately, the "if" statement does not detect the null value in the column and it attempts to store null in the "ExampleID" long variable and an error states "Specified cast is not valid.  When casting from a number, the value must be a number less than infinity."  What should I do to prevent accessing a null value?   Maurice

Cannot create user: server cannot determine if it is member of a domain

  
Hi, An instance of our 2008 SP1 SQL Server is running on a computer that was removed from it's domain and then re-added. Now, when I want to create a new login in Management Studio via the nodes Security/Logins, selecting "New Login", entering DOMAIN_NAME\USER_NAME as login name and then click "Search", I get an error message (in German) "Das Programm kann das erforderliche Dialogfeld nicht öffnen, da nicht ermittelt werden kann, ob Computer "COMPUTER_NAME" einer Domäne zugeordnet ist. Schließen Sie dieses Dialogfeld, und wiederholen Sie den Vorgang". Translation: "The program cannot open the required dialog, as it cannot be determined if computer "COMPUTER_NAME" is assigned to a domain. Close this dialog, and repeat the process." But closing the dialog and repeating as suggested does not help. Even restarting the SQL Server service and re-connecting in Management Studio did not help. I keep getting this message. I found, however, that just entering the domain and user name and then clicking Ok seems to add the user. Anyway, it is irritating to get this error message when clicking "Search". How can I tell the engine that the computer is really member of the domain again? Frank

How to determine when focus moves into a RowDetails panel in a DataGrid?

  
Is there a recommended way of determining when focus moves from the selected row into the details panel and knowing which field the focus is on? I don't really want to wire up all the controls in the panel, so am looking for a better way - all suggestions appreciated:-)

Determine whether HWND is WPF-based window or native one

  
Dear all The application I'm working on is targeted to share a window image. Given an HWND of a window, we use two approaches to capture it on Vista: native approach for native type of window - using BitBlt function, and Direct3D approach for WPF/Direct3D window which uses hardware for renderring. The question is, how to determing if a HWND is regular (so can be captured well with BitBlt) or is WPF-based or Direct3D-based, so Direct3D approach is needed to capture it. Is there a method to determin, which type of window the given HWND is? Regards, Marc

MSMQ TCP determine sender ip

  
Hello to pros from MSMQ newbie. We are trying to use client-server scenario with MSMQ (using FormatName:Direct=TCP:[ip]/private$/queName syntax).  Right now [ip] component is hardcoded into server since we don't know the machine from which the client application sends messages.  For now we assigned a particular computer for the purpose, hardcoded its ip into server's code of a running client app and that is obviously quite a handicapped solution.  What we would like to see is to maintain a database of authorized ip addresses that the server can accept messages from, then have a server determine ip of message's sender and reply to that machine . Any suggestions?  It seems I can determine machine Guid that sent the message.  Is that possible to retreive that machine's ip in our LAN (we don't expect to carry application outside)? P.S.: Our server runs as a Windows service.

MSMQ TCP determine sender ip

  
Hello to pros from MSMQ newbie. We are trying to use client-server scenario with MSMQ (using FormatName:Direct=TCP:[ip]/private$/queName syntax).  Right now [ip] component is hardcoded into server since we don't know the machine from which the client application sends messages.  For now we assigned a particular computer for the purpose, hardcoded its ip into server's code of a running client app and that is obviously quite a handicapped solution.  What we would like to see is to maintain a database of authorized ip addresses that the server can accept messages from, then have a server determine ip of message's sender and reply to that machine . Any suggestions?  It seems I can determine machine Guid that sent the message.  Is that possible to retreive that machine's ip in our LAN (we don't expect to carry application outside)? P.S.: Our server runs as a Windows service. I also am unable to add reference to Microsoft Message Queue com in add reference dialog, beacuse it's not there.

How to determine the contents of a variables in precedence constraint editor?

  
Hi All I am trying to create a precedence constraint on one of my SQL tasks, basically all I need to do it find out if a user variable (string Value) is equal to 'no'. I have tried and came up with this: @[User::NewMonth] = "no" However, as I am unfamiliar with the syntax, this is wrong and I get an error. Can anyone help or point me in the right direction? Thanks BigGopher  

Is it possible to determine if a deployed solution is in use?

  
Hi all, Is it possible to determine if a deployed solution is in use?  I'm trying to cleanup our 2007 farm prior to the 2010 upgrade and we have multiple solutions currently deployed that we don't think are still in use but would like to know for sure before we retract and delete them.  Aside from retracting the solution and waiting for complaints, is there any better way to determine if they're in use? Thanks

Using ASP.NET how can I determine what framework IIS is using?

  
Using ASP.NET how can I determine what framework IIS is using?  It seems that our server administrators don't keep the development and production servers in sync on the framework.

How does Linq to Sql Determine which tables to write to

  
I was wondering how Linq to Sql determines which tables to write to when given primary/foreign Key relationships.  I can (hopefully) better explain using an example.  I have the following tables: Customer CustomerStatus CustomerType CustomerAddresses Therefore I have a Customer Entity, a CustomerStatus entity, a CustomerType Entity and a List of CustomerAddresses.  In my code, I load up the Customer Entity and the List of CustomerAddresses because that's all I need.  For some reason Linq to Sql is trying to insert a new Customer Status record.  I have no idea why its doing this.  Can anyone please explain to me how linq to sql determines which table(s) will be written to based on the entities above? Thanks
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend