public string[] projectInfo(string projectName) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); String[] info=new String[8]; try { String quary = "select * from tbl_project where project='" + projectName + "'"; SqlCommand cmd = new SqlCommand(quary, con); using (SqlDataReader reader = cmd.ExecuteReader()) { reader.Read(); for (int i = 0; i < 8; i++) { info[i] = reader[i].ToString(); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } con.Close(); return info; }
public string[,] showResult(string tablename) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); String[,] info = new String[100, 5]; try { String quary = "select * from " + tablename + ""; SqlCommand cmd = new SqlCommand(quary, con); using (SqlDataReader reader = cmd.ExecuteReader()) { for (int i = 0; reader.Read(); i++) { info[i, 0] = reader["username"].ToString(); info[i, 1] = reader["name"].ToString(); info[i, 2] = reader["assaignedwork"].ToString(); info[i, 3] = reader["duedate"].ToString(); info[i, 4] = reader["status"].ToString(); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } con.Close(); return(info); }
public string[] showingData(string username,int flag) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); string query = "Select * from tbl_profile where name like '%" + username + "%'"; SqlCommand com = new SqlCommand(query, con); SqlDataReader reader = com.ExecuteReader(); for (int i = 1; reader.Read(); i++) { name[i] = reader[1].ToString(); uname[i] = reader[0].ToString(); } reader.Close(); con.Close(); if (flag == 1) { return name; } else { return uname; } }
public string[] showingData(string username, int flag) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); string query = "Select * from tbl_profile where name like '%" + username + "%'"; SqlCommand com = new SqlCommand(query, con); SqlDataReader reader = com.ExecuteReader(); for (int i = 1; reader.Read(); i++) { name[i] = reader[1].ToString(); uname[i] = reader[0].ToString(); } reader.Close(); con.Close(); if (flag == 1) { return(name); } else { return(uname); } }
public string[] projectInfo(string projectName) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); String[] info = new String[8]; try { String quary = "select * from tbl_project where project='" + projectName + "'"; SqlCommand cmd = new SqlCommand(quary, con); using (SqlDataReader reader = cmd.ExecuteReader()) { reader.Read(); for (int i = 0; i < 8; i++) { info[i] = reader[i].ToString(); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } con.Close(); return(info); }
public void createProjectTable(string tablename) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); try { String quary = "CREATE TABLE " + tablename + "(" + "username varchar(255)," + "name varchar(255)," + "assaignedwork varchar(255)," + "duedate varchar(255))"; SqlCommand cmd = new SqlCommand(quary, con); cmd.ExecuteNonQuery(); MessageBox.Show("Table Created"); } catch (Exception ex) { MessageBox.Show(ex.Message); } con.Close(); }
public string[,] showResult(string tablename) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); String[,] info = new String[100,5]; try { String quary = "select * from "+tablename+""; SqlCommand cmd = new SqlCommand(quary, con); using (SqlDataReader reader = cmd.ExecuteReader()) { for (int i = 0; reader.Read();i++ ) { info[i,0] = reader["username"].ToString(); info[i,1] = reader["name"].ToString(); info[i,2] = reader["assaignedwork"].ToString(); info[i,3] = reader["duedate"].ToString(); info[i,4] = reader["status"].ToString(); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } con.Close(); return info; }
public string[] projectDisplay(string username) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); int counter=0; String[] info=new String[10]; try { //1st Person String quary = "select * from tbl_project where people1username='******'"; SqlCommand cmd = new SqlCommand(quary, con); using (SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { info[counter++] = reader["project"].ToString(); } } //2nd person quary = "select * from tbl_project where people2username='******'"; cmd = new SqlCommand(quary, con); using (SqlDataReader reader1 = cmd.ExecuteReader()) { while (reader1.Read()) { info[counter++] = reader1["project"].ToString(); } } //3rd person quary = "select * from tbl_project where people3username='******'"; cmd = new SqlCommand(quary, con); using (SqlDataReader reader2 = cmd.ExecuteReader()) { while (reader2.Read()) { info[counter++] = reader2["project"].ToString(); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } con.Close(); return info; }
public string[] projectDisplay(string username) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); int counter = 0; String[] info = new String[10]; try { //1st Person String quary = "select * from tbl_project where people1username='******'"; SqlCommand cmd = new SqlCommand(quary, con); using (SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { info[counter++] = reader["project"].ToString(); } } //2nd person quary = "select * from tbl_project where people2username='******'"; cmd = new SqlCommand(quary, con); using (SqlDataReader reader1 = cmd.ExecuteReader()) { while (reader1.Read()) { info[counter++] = reader1["project"].ToString(); } } //3rd person quary = "select * from tbl_project where people3username='******'"; cmd = new SqlCommand(quary, con); using (SqlDataReader reader2 = cmd.ExecuteReader()) { while (reader2.Read()) { info[counter++] = reader2["project"].ToString(); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } con.Close(); return(info); }
public int noOfList(string tablename) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); int rows = 0; String query = "select * from " + tablename + ""; SqlCommand cmd = new SqlCommand(query, con); SqlDataReader reader = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(reader); rows = dt.Rows.Count; return rows; }
public int noOfList(string tablename) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); int rows = 0; String query = "select * from " + tablename + ""; SqlCommand cmd = new SqlCommand(query, con); SqlDataReader reader = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(reader); rows = dt.Rows.Count; return(rows); }
public string[] getInfo(string projectname) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); String[] info=new String[8]; String quary; SqlCommand com; try { } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public string[] getInfo(string projectname) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); String[] info = new String[8]; String quary; SqlCommand com; try { } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void editPassword(string username, string password) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); try { String query = "UPDATE tbl_authenticate SET password='******'where username='******'"; SqlCommand cmd = new SqlCommand(query, con); cmd.ExecuteNonQuery(); con.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void addToDo(string username, string name, string todo, string date, string table) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); try { String query = "INSERT INTO " + table + " VALUES('" + username + "','" + name + "','" + todo + "','" + date + "','" + "false" + "')"; SqlCommand cmd = new SqlCommand(query, con); cmd.ExecuteNonQuery(); MessageBox.Show("Assaigned Work Added!!!"); con.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } con.Close(); }
public void projectAdd(string projecttitle, string description, string uname1, string name1, string uname2, string name2, string uname3, string name3) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); try { String query = "INSERT INTO tbl_project VALUES('" + projecttitle + "','" + description + "','" + uname1 + "','" + name1 + "','" + uname2 + "','" + name2 + "','" + uname3 + "','" + name3 + "')"; SqlCommand cmd = new SqlCommand(query, con); cmd.ExecuteNonQuery(); MessageBox.Show("Project Added!!!"); con.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } con.Close(); }
public string editInfo(string username, string name, string designation, string email, string phoneno, string address,string dob,string gender) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); try { String query = "UPDATE tbl_profile SET name='" + name + "',username='******',designation='" + designation + "',email='" + email + "',phoneno='" + phoneno + "',address='" + address + "',dateofbirth='" + dob + "',gender='" + gender + "'where username='******'"; SqlCommand cmd = new SqlCommand(query, con); cmd.ExecuteNonQuery(); con.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } return username; }
public Boolean LoginConnection(string userName, string password) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); int rows = 0; string uName = userName; string pass = password; String query = "select * from tbl_authenticate where username='******' and password='******'"; SqlCommand cmd = new SqlCommand(query, con); SqlDataReader reader = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(reader); rows = dt.Rows.Count; if (rows > 0) return true; else return false; }
public void updateProject(string name, string description, string user1, string name1, string user2, string name2, string user3, string name3, string projectname) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); try { String query = "UPDATE tbl_project SET project='" + name + "',projectdescription='" + description + "',people1username='******',people1name='" + name1 + "',people2username='******',people2name='" + name2 + "',people3username='******',people3name='" + name3 + "'where project='" + projectname + "'"; SqlCommand cmd = new SqlCommand(query, con); cmd.ExecuteNonQuery(); // MessageBox.Show(name+" "+description+" "+user1+" "+name1+" "+user2+" "+name2+" "+user3+" "+name3+" Edited!!!!"); con.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void updateProject(string name, string description, string user1, string name1, string user2, string name2, string user3, string name3, string projectname) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); try { String query = "UPDATE tbl_project SET project='" + name + "',projectdescription='" + description + "',people1username='******',people1name='" + name1 + "',people2username='******',people2name='" + name2 + "',people3username='******',people3name='" + name3 + "'where project='" + projectname + "'"; SqlCommand cmd = new SqlCommand(query, con); cmd.ExecuteNonQuery(); // MessageBox.Show(name+" "+description+" "+user1+" "+name1+" "+user2+" "+name2+" "+user3+" "+name3+" Edited!!!!"); con.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void updateTodo(string username, string name, string work, string date, string status, string tablename, string assaingn) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); try { String query = "UPDATE " + tablename + " SET username='******',name='" + name + "',assaignedwork='" + work + "',duedate='" + date + "',status='" + status + "'where assaignedwork='" + assaingn + "'"; SqlCommand cmd = new SqlCommand(query, con); cmd.ExecuteNonQuery(); MessageBox.Show(" Edited!!!!"); con.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public int nameCheck(string name) { int rows = 0; Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); try { string query = "Select * from tbl_profile where name like '%" + name + "%'"; SqlCommand cmd = new SqlCommand(query, con); SqlDataReader reader = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(reader); rows = dt.Rows.Count; } catch (Exception ex) { MessageBox.Show(ex.Message); } return(rows); }
public void addToDo(string username, string name, string todo, string date, string table) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); try { String query = "INSERT INTO "+table+" VALUES('" + username + "','" + name + "','" + todo + "','" + date + "','" + "false" + "')"; SqlCommand cmd = new SqlCommand(query, con); cmd.ExecuteNonQuery(); MessageBox.Show("Assaigned Work Added!!!"); con.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } con.Close(); }
public void projectAdd(string projecttitle,string description,string uname1,string name1,string uname2,string name2, string uname3,string name3) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); try { String query = "INSERT INTO tbl_project VALUES('" + projecttitle + "','" +description + "','" + uname1 + "','" +name1 + "','" + uname2 + "','" +name2 + "','" + uname3 + "','" + name3 + "')"; SqlCommand cmd = new SqlCommand(query, con); cmd.ExecuteNonQuery(); MessageBox.Show("Project Added!!!"); con.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } con.Close(); }
public int nameCheck(string name) { int rows = 0; Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); try { string query = "Select * from tbl_profile where name like '%" + name + "%'"; SqlCommand cmd = new SqlCommand(query, con); SqlDataReader reader = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(reader); rows = dt.Rows.Count; } catch (Exception ex) { MessageBox.Show(ex.Message); } return rows; }
public void updateTable(string oldname, string newname) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); //try //{ String query = "sp_rename '" + oldname + "','" + newname + "'"; SqlCommand cmd = new SqlCommand(query, con); cmd.ExecuteNonQuery(); MessageBox.Show(oldname + " "+" Edited"); con.Close(); //} //catch (Exception ex) //{ //MessageBox.Show(ex.Message); //} }
public int checkProject(string projecttitle) { int rows = 0; Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); try { String query = "select * from tbl_project where project='" + projecttitle + "'"; SqlCommand cmd = new SqlCommand(query, con); SqlDataReader reader = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(reader); rows = dt.Rows.Count; } catch (Exception ex) { MessageBox.Show(ex.Message); } con.Close(); return rows; }
public int checkProject(string projecttitle) { int rows = 0; Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); try { String query = "select * from tbl_project where project='" + projecttitle + "'"; SqlCommand cmd = new SqlCommand(query, con); SqlDataReader reader = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(reader); rows = dt.Rows.Count; } catch (Exception ex) { MessageBox.Show(ex.Message); } con.Close(); return(rows); }
public void updateTable(string oldname, string newname) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); //try //{ String query = "sp_rename '" + oldname + "','" + newname + "'"; SqlCommand cmd = new SqlCommand(query, con); cmd.ExecuteNonQuery(); MessageBox.Show(oldname + " " + " Edited"); con.Close(); //} //catch (Exception ex) //{ //MessageBox.Show(ex.Message); //} }
public void updateTodo(string username, string name, string work, string date, string status, string tablename, string assaingn) { Connection cs = new Connection(); SqlConnection con = cs.CreateConnection(); try { String query = "UPDATE "+tablename+" SET username='******',name='" + name + "',assaignedwork='" + work + "',duedate='" + date + "',status='" + status + "'where assaignedwork='" + assaingn + "'"; SqlCommand cmd = new SqlCommand(query, con); cmd.ExecuteNonQuery(); MessageBox.Show(" Edited!!!!"); con.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }