public void SelectUsers(string Email) { daUser da = new daUser(); m_dataset = da.UserByEmail(Email); RefreshMemberVariables(); }
// This function verifies a user in the tblUser table public static dsUser VerifyUser(string Database, string UserName, string UserPassword) { // This defines a new user for the DS, as well as connection and adapter dsUser DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; // This defines a new connection sqlConn = new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Database); // This returns all fields in the Security level field of the table sqlDA = new OleDbDataAdapter("Select SecurityLevel from tblUserLogin " + "where UserName like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'", sqlConn); // New user to store in the dataset DS = new dsUser(); // This fills the fields in the userLogin table sqlDA.Fill(DS.tblUserLogin); // Add your comments here return(DS); }
// This function verifies a user in the tblUser table public static dsUser VerifyUser(string Database, string UserName, string UserPassword) { // Add your comments here dsUser DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; // Add your comments here sqlConn = new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Database); // Add your comments here sqlDA = new OleDbDataAdapter("Select SecurityLevel from tblUserLogin " + "where UserName like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'", sqlConn); // Add your comments here DS = new dsUser(); // Add your comments here sqlDA.Fill(DS.tblUserLogin); // Add your comments here return(DS); }
// This function verifies a user in the tblUser table public static dsUser VerifyUser(string Database, string UserName, string UserPassword) { // Create dataset object dsUser DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; // Create database connection sqlConn = new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Database); // Open database sqlDA = new OleDbDataAdapter("Select SecurityLevel from tblUserLogin " + "where UserName like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'", sqlConn); // Allocates memory DS = new dsUser(); // Fill dataset sqlDA.Fill(DS.tblUserLogin); // Return data return(DS); }
// This function verifies a user in the tblUser table exists public static dsUser VerifyUser(string Database, string UserName, string UserPassword) { // Allocate memory for dsUser dataset, connection, and data adaptor objects dsUser DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; // Make a connection to the database sqlConn = new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Database); // Instantiate and import the information from the login form into the data adaptor object sqlDA = new OleDbDataAdapter("Select SecurityLevel from tblUserLogin " + "where UserName like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'", sqlConn); // Instantiate the dataset object DS = new dsUser(); // Put the imported information into the dataset table sqlDA.Fill(DS.tblUserLogin); // Send the dataset back to the calling form for display return(DS); }
// This function verifies a user in the tblUser table public static dsUser VerifyUser(string Database, string UserName, string UserPassword) { // Define and intialize data set user, sql Connection, sql Data Adpater dsUser DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; // Set Sql connection read Microsoft jet for for the data source to output tables in the database sqlConn = new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Database); // Set the sql Data Adpater read tables from user login sqlDA = new OleDbDataAdapter("Select SecurityLevel from tblUserLogin " + "where UserName like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'", sqlConn); // define a new user DS = new dsUser(); // Fill the Data Adpatber from tables in the user login sqlDA.Fill(DS.tblUserLogin); // return the DS variable, or the DS user return(DS); }
// This function verifies a user in the tblUser table public static dsUser VerifyUser(string Database, string UserName, string UserPassword) { // Create dataset object dsUser DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; // Create database connection sqlConn = new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Database); // Open database sqlDA = new OleDbDataAdapter("Select SecurityLevel from tblUserLogin " + "where UserName like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'", sqlConn); // Allocates memory DS = new dsUser(); // Fill dataset sqlDA.Fill(DS.tblUserLogin); // Return data return DS; }
// This function verifies a user in the tblUser table public static dsUser VerifyUser(string Database, string UserName, string UserPassword) { // variables to connect to database dsUser DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; // Create object to connect to database sqlConn = new OleDbConnection("PROVIDER=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + Database); // Create object to grab data from table sqlDA = new OleDbDataAdapter("Select SecurityLevel from tblUserLogin " + "where UserName like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'", sqlConn); // Object to create new dataset DS = new dsUser(); // Fill in the object with the data sqlDA.Fill(DS.tblUserLogin); // Pass the data through return(DS); }
//public dsUser GetDataSetCopy() //check ?? needed?? //{ // if (m_dataset==null) // { // return null; // } // else // { // return (dsUser)m_dataset.Copy(); // } //} public void LoadAll() { daUser da = new daUser(); m_dataset = da.GetAllUsers(); RefreshMemberVariables(); }
//This function verifies a user in the tblUser table public static dsUser VerifyUser(string Database, string UserName, string UserPassword) { //Initializes the datasheet dsUser DS; //Initializes the Connection OleDbConnection sqlConn; //Initializes the Adapter OleDbDataAdapter sqlDA; //sets the Connection sqlConn = new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Database); //Prepares the adapter sqlDA = new OleDbDataAdapter("Select SecurityLevel from tblUserLogin " + "where UserName like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'", sqlConn); //Sets the data set equal to the User table DS = new dsUser(); //Fills the Adapter sqlDA.Fill(DS.tblUserLogin); //Returns the information about the user permission level return(DS); }
public override global::System.Data.DataSet Clone() { dsUser cln = ((dsUser)(base.Clone())); cln.InitVars(); cln.SchemaSerializationMode = this.SchemaSerializationMode; return(cln); }
public static int InsertUserInfo(dsUser.UserInfoRow row) { try { UserInfoTableAdapter taUserInfo = new UserInfoTableAdapter(); int userId = taUserInfo.Insert(row.FName, row.LName, row.Street, row.Apartment, row.City, row.State, row.ZIP, row.Phone, row.logonEmail, row.logonPW, row.UtilityAccountNumber, row.B_FName, row.B_LName, row.B_Street, row.B_Apartment, row.B_City, row.B_State, row.B_ZIP, row.B_Phone, row.B_email); return userId; } catch { return 0; } }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { dsUser ds = new dsUser(); global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny(); any.Namespace = ds.Namespace; sequence.Items.Add(any); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte()));) { ; } if ((s1.Position == s1.Length)) { return(type); } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return(type); }
public dsUser SearchUser(string username) { // declare new User dataset dsUser DS; OleDbDataAdapter sqlDA; // Create adapter sqlDA = new OleDbDataAdapter("Select Username from tblUsers WHERE Username LIKE '" + username + "'", dbConnection); // initialize new user dataset DS = new dsUser(); // Fill dataset with userlogin table data sqlDA.Fill(DS.tblUsers); // Return filled dataset return(DS); }
public dsUser UserDetails(string Username) { //sql query string sqlStmt = "SELECT * FROM tblUsers WHERE Username LIKE '" + Username + "'"; OleDbDataAdapter sqlDataAdapter = new OleDbDataAdapter(sqlStmt, dbConnection); //create and fill dataset dsUser userDataSet = new dsUser(); sqlDataAdapter.Fill(userDataSet.tblUsers); //return filled dataset return(userDataSet); }
public dsUser VerifyUser(string UserName, string UserPassword) { // declare new User dataset dsUser DS; OleDbDataAdapter sqlDA; // Create adapter sqlDA = new OleDbDataAdapter("Select * FROM tblUsers WHERE Username LIKE '" + UserName + "' " + "and Password LIKE '" + UserPassword + "'", dbConnection); // initialize new user dataset DS = new dsUser(); // Fill dataset with userlogin table data sqlDA.Fill(DS.tblUsers); // Return filled dataset return(DS); }
public UserEnumerator( Users p_Users, dsUser p_dsUser) { if (p_Users == null || p_dsUser == null) { throw new ArgumentNullException( "Users or dsUser", "Cannot initialize UserEnumerator. Arguments cannot be null."); } else { m_Users = p_Users; //m_rowEnumerator= // p_dsUser.Users.Rows.GetEnumerator(); ?? } }
//Added 11/18/19 VerifyUser verifys the user name and password of the person logging in - Jowy Muzzo public static dsUser VerifyUser(string Database, string UserName, string UserPassword) { dsUser DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; // creates new connection to database sqlConn = new OleDbConnection("PROVIDER=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + Database); //Select statement to verify user sqlDA = new OleDbDataAdapter("Select UserSecLevel from Users " + "where UserLogon like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'", sqlConn); DS = new dsUser(); sqlDA.Fill(DS.Users); return(DS); }
//Start of Week 6 additions // This function verifies a user in the tblUser table public static dsUser VerifyUser(string Database, string UserName, string UserPassword) { // Here we set the variables for our user dataset dsUser DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; // Starting a new connection to the dataset sqlConn = new OleDbConnection("PROVIDER=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + Database); // Find out the user's security level sqlDA = new OleDbDataAdapter("Select SecurityLevel from tblUserLogin " + "where UserName like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'", sqlConn); // Start a new instance of the user in the dataset DS = new dsUser(); // Adds the user's info to the db table sqlDA.Fill(DS.tblUserLogin); // returns the dsUser dataset info return(DS); }
// This function verifies a user in the tblUser table public static dsUser VerifyUser(string Database, string UserName, string UserPassword) { //Create variables dsUser DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; //Create the connection string sqlConn = new OleDbConnection("PROVIDER=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + Database); //Define sqlDA and what it will consist of sqlDA = new OleDbDataAdapter("Select SecurityLevel from tblUserLogin " + "where UserName like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'", sqlConn); //Define DS and what it will consist of DS = new dsUser(); //Output results from information gathered from table sqlDA.Fill(DS.tblUserLogin); //Starts over for a new user return(DS); }
public static dsUser fetchUserID(string Database, string UserName, string UserPassword) { // creating objects dsUser DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; // connecting database using sqlConn object sqlConn = new OleDbConnection("PROVIDER=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + Database); // assigning data adapter to sqlDA object sqlDA = new OleDbDataAdapter("Select UserID from tblUsers " + "where ContractNumber like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'", sqlConn); // assigning new dsUser to DS object DS = new dsUser(); // filling userlogin data to adapter sqlDA.Fill(DS.tblUsers); // returning dsUser object return(DS); }
// This function verifies a user in the tblUser table public static dsUser VerifyUser(string Database, string UserName, string UserPassword) { // Declares composition variables to dataset, connection to the database, and database adapter dsUser DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; // instantiates previously declared variable as object sqlConn = new OleDbConnection("PROVIDER=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + Database); // instantiates previously declared variable as object sqlDA = new OleDbDataAdapter("Select SecurityLevel from tblUserLogin " + "where UserName like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'", sqlConn); // instantiates previously declared variable as object DS = new dsUser(); // allows adapter to be filled with information from database table sqlDA.Fill(DS.tblUserLogin); // returns information that verifies a user in the tblUser table return(DS); }
// This function verifies a user in the tblUser table public static dsUser VerifyUser(string Database, string UserName, string UserPassword) { //setting vars dsUser DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; // setting var to open the db sqlConn = new OleDbConnection("PROVIDER=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + Database); // setting var to input the info into the db sqlDA = new OleDbDataAdapter("Select SecurityLevel from tblUserLogin " + "where UserName like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'", sqlConn); //setting dataset to user DS = new dsUser(); // add user info to table sqlDA.Fill(DS.tblUserLogin); // return if valid or not return(DS); }
// This function verifies a user in the tblUser table public static dsUser VerifyUser(string Database, string UserName, string UserPassword) { // Create a dataset object of dsUser dataset dsUser DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; // Create a connection to the database sqlConn = new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Database); // open dataadapter and set the query sqlDA = new OleDbDataAdapter("Select SecurityLevel from tblUserLogin " + "where UserName like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'", sqlConn); // allocate memory to the dataset object DS = new dsUser(); // fill the dataset using the dataadapter sqlDA.Fill(DS.tblUserLogin); // return the filled dataset with the data return(DS); }
// This function verifies a user in the tblUser table public static dsUser VerifyUser(string Database, string UserName, string UserPassword) { // Define database objects dsUser DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; // set sqlConn connection sqlConn = new OleDbConnection("PROVIDER=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + Database); // set sqlDA to get username and password values sqlDA = new OleDbDataAdapter("Select SecurityLevel from tblUserLogin " + "where UserName like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'", sqlConn); // define DS as dsUser object DS = new dsUser(); // refresh rows in table sqlDA.Fill(DS.tblUserLogin); // return DS return(DS); }
// This function verifies a user in the tblUser table public static dsUser VerifyUser(string Database, string UserName, string UserPassword) { // create new instance of dsUser, Connection and adapter dsUser DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; // create new connection sqlConn = new OleDbConnection("PROVIDER=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + Database); // set the data adapter sqlDA = new OleDbDataAdapter("Select SecurityLevel from tblUserLogin " + "where UserName like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'", sqlConn); // instantiate DS DS = new dsUser(); // populate the data sqlDA.Fill(DS.tblUserLogin); // ds returned return(DS); }
// This function verifies a user in the tblUser table public static dsUser VerifyUser(string Database, string UserName, string UserPassword) { //Initializes connection to the dsUser data set dsUser DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; //Creates new connection to the dsUser data set sqlConn = new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Database); // Connects to the UserLogin database sqlDA = new OleDbDataAdapter("Select SecurityLevel from tblUserLogin " + "where UserName like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'", sqlConn); // Adds new user to the dataset DS = new dsUser(); // Fills the data into the table sqlDA.Fill(DS.tblUserLogin); // Returns the data set return(DS); }
public static dsUser VerifyUser(string Database, string UserName, string UserPassword) { dsUser DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; sqlConn = new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;" + "Data Source=(C:\\xxampp\\htdocs\\beuwebsite\\BEUapplication\\BEUapplication\\BEUapplication\\App_Data\\BEUbusinessBB1.mdb"); sqlDA = new OleDbDataAdapter("select * SecurityLevel from admin " + "where username like '" + username + "' " + "and password like '" + password + "'", sqlConn); DS = new dsUser(); sqlDA.Fill(DS.admin); return(DS); }
private void InsertNewUser(dsUser.UserInfoRow row) { try { if (txtEmail_NewUser.Text.Equals(string.Empty) || txtPassword_NewUser.Text.Equals(string.Empty)) { lblSaveResult.Text = "Email and/or password can not be empty."; return; } int userId = 0; row.logonEmail = txtEmail_NewUser.Text; row.logonPW = txtPassword_NewUser.Text; if (UserBL.InsertUserInfo(row) > 0) { userId = UserBL.GetUserId(row.logonEmail, row.logonPW); Session["LoggedUserId"] = userId; HtmlAnchor linkLogin = (HtmlAnchor)this.Master.FindControl("linkLogin"); linkLogin.InnerText = "Logout"; lblSaveResult.Text = "Your Account is Successfully Registered."; } } catch { lblSaveResult.Text = "Error occured. Please try later."; } }
// This function verifies a user in the tblUser table public static dsUser VerifyUser(string Database, string UserName, string UserPassword) { // Declares composition variables to dataset, connection to the database, and database adapter dsUser DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; // instantiates previously declared variable as object sqlConn = new OleDbConnection("PROVIDER=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + Database); // instantiates previously declared variable as object sqlDA = new OleDbDataAdapter("Select SecurityLevel from tblUserLogin " + "where UserName like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'", sqlConn); // instantiates previously declared variable as object DS = new dsUser(); // allows adapter to be filled with information from database table sqlDA.Fill(DS.tblUserLogin); // returns information that verifies a user in the tblUser table return DS; }
//public static bool UpdateUserInfo(string fName, string lName,string street,string apartment,string city,string state,string zip,string logonEmail, string logonPW, string phone,string utilityAccountNumber,string B_FName,string B_Lname,string B_Street,string B_apartment,string B_City,string B_State,string B_Zip, string B_Phone,string B_email, int userId) //{ // UserInfoTableAdapter taUserInfo = new UserInfoTableAdapter(); // int resultCount = taUserInfo.UpdateUser(fName,lName,street,apartment,city,state,zip,phone,logonEmail,logonPW,utilityAccountNumber,B_FName,B_Lname,B_Street,B_apartment,B_City,B_State,B_Zip,B_Phone,B_email,userId); // if (resultCount > 0) // { // return true; // } // return false; //} public static bool UpdateUserInfo(dsUser.UserInfoRow row) { try { UserInfoTableAdapter taUserInfo = new UserInfoTableAdapter(); int resultCount = taUserInfo.UpdateUser(row.FName, row.LName, row.Street, row.Apartment, row.City, row.State, row.ZIP, row.Phone, row.logonEmail, row.UtilityAccountNumber, row.B_FName, row.B_LName, row.B_Street, row.B_Apartment, row.B_City, row.B_State, row.B_ZIP, row.B_Phone, row.B_email, row.UserID); if (resultCount > 0) { if (row.logonPW != null) { if (!row.logonPW.Equals(string.Empty)) { taUserInfo.UpdatePassword(row.logonPW, row.UserID); } } return true; } return false; } catch { return false; } }
// This function verifies a user in the tblUser table exists public static dsUser VerifyUser(string Database, string UserName, string UserPassword) { // Allocate memory for dsUser dataset, connection, and data adaptor objects dsUser DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; // Make a connection to the database sqlConn = new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Database); // Instantiate and import the information from the login form into the data adaptor object sqlDA = new OleDbDataAdapter("Select SecurityLevel from tblUserLogin " + "where UserName like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'", sqlConn); // Instantiate the dataset object DS = new dsUser(); // Put the imported information into the dataset table sqlDA.Fill(DS.tblUserLogin); // Send the dataset back to the calling form for display return DS; }
public User() { m_dataset = new dsUser(); }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); dsUser ds = new dsUser(); global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); any1.Namespace = "http://www.w3.org/2001/XMLSchema"; any1.MinOccurs = new decimal(0); any1.MaxOccurs = decimal.MaxValue; any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any1); global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; any2.MinOccurs = new decimal(1); any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any2); global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute1.Name = "namespace"; attribute1.FixedValue = ds.Namespace; type.Attributes.Add(attribute1); global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute2.Name = "tableTypeName"; attribute2.FixedValue = "MLUSERDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte()));) { ; } if ((s1.Position == s1.Length)) { return(type); } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return(type); }
// This function verifies a user in the tblUser table public static dsUser VerifyUser(string Database, string UserName, string UserPassword) { // Add your comments here dsUser DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA; // Add your comments here sqlConn = new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Database); // Add your comments here sqlDA = new OleDbDataAdapter("Select SecurityLevel from tblUserLogin " + "where UserName like '" + UserName + "' " + "and UserPassword like '" + UserPassword + "'", sqlConn); // Add your comments here DS = new dsUser(); // Add your comments here sqlDA.Fill(DS.tblUserLogin); // Add your comments here return DS; }