Data Table Not Updating


  • I built a program that has a simple Login,and the user names and passwords are stored in a database. When the program starts up it allows the user to login or create a new account. When the account is created the values are inserted into the database and all is well.
    Once inside the actual program I made a button that would display a Data Grid filled with the all the user names and accounts, just to make sure all the accounts were still good. Once again everything is fine. The new accounts were added and the old accounts stayed fine. The problem is that when I take the program out of the IDE and publish it, and just run it on its on, the table doesn't display the new accounts. It only displays the three preset accounts I had manually entered when creating the database. I don't recieve any errors or problems, and when I add a new account I am still able to log in as it, it just doesnt show up in the table.

    I don't understand why the table works fine in the IDE but not while its published,

    Any help would be great!

    Thursday, January 29, 2009 12:20 AM

All replies

  •  Permissions.
    Thursday, January 29, 2009 12:28 AM
  • Could you elaborate on that?
    Thursday, January 29, 2009 12:29 AM
  • Hi,

    Check this post out:

    Hope it helps
    Tuesday, February 03, 2009 9:48 AM

  • Hi,

    You should give the full permission to your database.

    • Edited by DivyalokSuman Tuesday, February 03, 2009 11:39 AM addes name
    Tuesday, February 03, 2009 11:35 AM
  • GNic24 said:

    Could you elaborate on that?

    You can use one of the routines I posted below to set Access Control Rule for the directory in question. After that it will work for you.

          public static void setAccessRule ( string directory )  
                System.Security.AccessControl.DirectorySecurity sec =  
                                        System.IO.Directory.GetAccessControl ( directory );  
                FileSystemAccessRule accRule = new FileSystemAccessRule (   
                    Environment.UserDomainName + "\\" + Environment.UserName,  
                     FileSystemRights.FullControl, AccessControlType.Allow );  
                sec.AddAccessRule ( accRule );  
            }                                               // setACL  
            public static void SetPermission (string folderPath, string user, FileSystemRights rights )  
                DirectoryInfo dInfo = new DirectoryInfo ( folderPath );  
                DirectorySecurity oDirectorySecurity = new DirectorySecurity ( );  
                oDirectorySecurity.AddAccessRule ( new FileSystemAccessRule ( user, rights, AccessControlType.Allow ) );  
                dInfo.SetAccessControl ( oDirectorySecurity );  

    Tuesday, February 03, 2009 9:02 PM