本文整理汇总了C#中DAL.ClassConnectDB.SelectWhereSqlDataReader方法的典型用法代码示例。如果您正苦于以下问题:C# ClassConnectDB.SelectWhereSqlDataReader方法的具体用法?C# ClassConnectDB.SelectWhereSqlDataReader怎么用?C# ClassConnectDB.SelectWhereSqlDataReader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DAL.ClassConnectDB
的用法示例。
在下文中一共展示了ClassConnectDB.SelectWhereSqlDataReader方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: checkForgotPassword
public static Entity.Teacher checkForgotPassword(string username, string email)
{
try
{
string sqlforgot = " SELECT * FROM Teacher WHERE [email protected] AND [email protected]";
string Addvalue = "@user,@email";
string value = username + "," + email;
Entity.Teacher tchCheck = new Entity.Teacher();
ClassConnectDB conn = new ClassConnectDB();
SqlDataReader readCheckRole = conn.SelectWhereSqlDataReader(sqlforgot, Addvalue, value);
//SqlDataReader readCheckRole = conn.SelectSqlDataReader(sqlforgot);
if (readCheckRole.Read())
{
tchCheck.Tch_FName = readCheckRole["Tch_FName"].ToString();
tchCheck.Tch_LName = readCheckRole["Tch_LName"].ToString();
tchCheck.Tch_username = readCheckRole["Tch_username"].ToString();
tchCheck.Tch_password = readCheckRole["Tch_password"].ToString();
tchCheck.Tch_email = readCheckRole["Tch_email"].ToString();
}
conn.Close();
return tchCheck;
}
catch (Exception)
{
return null;
}
}
示例2: checkForgotPassword
public static Entity.Employee checkForgotPassword(string username, string email)
{
try
{
string sqlforgot = " SELECT * FROM Employee WHERE [email protected] AND [email protected]";
string Addvalue = "@user,@email";
string value = username + "," + email;
Entity.Employee empCheck = new Entity.Employee();
ClassConnectDB conn = new ClassConnectDB();
SqlDataReader readCheckRole = conn.SelectWhereSqlDataReader(sqlforgot, Addvalue, value);
//SqlDataReader readCheckRole = conn.SelectSqlDataReader(sqlforgot);
if (readCheckRole.Read())
{
empCheck.Emp_FName = readCheckRole["Emp_FName"].ToString();
empCheck.Emp_LName = readCheckRole["Emp_LName"].ToString();
empCheck.Emp_username = readCheckRole["Emp_username"].ToString();
empCheck.Emp_password = readCheckRole["Emp_password"].ToString();
empCheck.Emp_Email = readCheckRole["Emp_Email"].ToString();
}
conn.Close();
return empCheck;
}
catch (Exception)
{
return null;
}
}
示例3: checkForgotPassword
public static Entity.Student checkForgotPassword(string username, string email)
{
try
{
string sqlforgot = " SELECT * FROM Student WHERE [email protected] AND [email protected]";
string Addvalue = "@user,@email";
string value = username + "," + email;
Entity.Student stdCheck = new Entity.Student();
ClassConnectDB conn = new ClassConnectDB();
SqlDataReader readCheckRole = conn.SelectWhereSqlDataReader(sqlforgot, Addvalue, value);
//SqlDataReader readCheckRole = conn.SelectSqlDataReader(sqlforgot);
if (readCheckRole.Read())
{
stdCheck.Std_FName = readCheckRole["Std_FName"].ToString();
stdCheck.Std_LName = readCheckRole["Std_LName"].ToString();
stdCheck.Std_Username = readCheckRole["Std_Username"].ToString();
stdCheck.Std_Password = readCheckRole["Std_Password"].ToString();
stdCheck.Std_email = readCheckRole["Std_email"].ToString();
}
conn.Close();
return stdCheck;
}
catch (Exception)
{
return null;
}
}
示例4: selectCuriID
public static string selectCuriID(string curYear, string curCourse, string curGroup)
{
ClassConnectDB con=new ClassConnectDB();
string reid="";
try
{
string [email protected]"SELECT Curri_Id
FROM Curriculum Where [email protected] AND [email protected] AND [email protected]";
string Addvalue="@year,@co,@group";
string value=curYear+","+curCourse+","+curGroup;
SqlDataReader dr= con.SelectWhereSqlDataReader(sqlSelect,Addvalue,value);
if (dr.Read())
{
reid = dr["Curri_Id"].ToString();
}
return reid;
}
catch (Exception)
{
return "";
}
con.Close();
}
示例5: insertDetailTeachAfter
public static bool insertDetailTeachAfter(string year, string level, string term, string group, string subject, string userid)
{
ClassConnectDB conn = new ClassConnectDB();
string sqlcheckvalue = "SELECT DetailTech_ID FROM DetailTech WHERE [email protected] and [email protected] and DetailTeach_Year [email protected] and [email protected] and [email protected]";
string addvaluecheck = "@level,@class,@year,@term,@code";
string valuecheck = level + "," + group + "," + year + "," + term + "," + subject;
SqlDataReader drrcheck = conn.SelectWhereSqlDataReader(sqlcheckvalue, addvaluecheck, valuecheck);
if (!drrcheck.HasRows)
{
string sql = @"INSERT INTO DetailTech
(DetailTech_Level, DetailTech_Class, DetailTeach_Year, DetailTech_Term, StructSub_Code, Create_user, CreateDate)
VALUES(@level,@class,@year,@term,@code,@user,getDate())";
string addvalue = "@level,@class,@year,@term,@code,@user";
string value = level + "," + group + "," + year + "," + term + "," + subject + "," + userid;
bool insert = conn.InsertValue(sql, addvalue, value);
conn.Close();
if (insert) { return true; }
else { return false; }
}
else
{
return false;
}
}
示例6: checkRoleLogin
public static Entity.Student checkRoleLogin(string username, string password)
{
try
{
Entity.Student stdlog = new Entity.Student();
string sqlchekRole = " SELECT * FROM Student WHERE (Std_Username = @user) AND (Std_Password = @pass)";
string Addvalue = "@user,@pass";
string value = username + "," + password;
ClassConnectDB conn = new ClassConnectDB();
SqlDataReader readCheckRole = conn.SelectWhereSqlDataReader(sqlchekRole, Addvalue, value);
if (readCheckRole.Read())
{
stdlog.Std_Type = readCheckRole["Std_Type"].ToString();
stdlog.Std_FName = readCheckRole["Std_FName"].ToString();
stdlog.Std_LName = readCheckRole["Std_LName"].ToString();
stdlog.Std_Campus_Code = readCheckRole["Std_Campus_Code"].ToString();
stdlog.Std_YearEducate = readCheckRole["Std_YearEducate"].ToString();
stdlog.Std_Username = readCheckRole["Std_Username"].ToString();
stdlog.Std_Password = readCheckRole["Std_Password"].ToString();
stdlog.std_picturepath = readCheckRole["Std_picturepath"].ToString();
}
string iplog = Common.network.showIp();
string logdate = "CONVERT(VARCHAR(10), GETDATE(), 104)";
string logtime = "CONVERT(VARCHAR(8), GETDATE(), 108)";
string tid = readCheckRole["Std_Campus_Code"].ToString();
string insertLog = "INSERT INTO LogLogInStd(Log_IP, Log_Date, Log_timeStart, Std_Campus_Code) VALUES('" + iplog + "'," + logdate + "," + logtime + "," + tid + ")";
conn.QueryExecuteNonQuery(insertLog);
conn.Close();
return stdlog;
}
catch (Exception)
{
return null;
}
}
示例7: checkRoleLogin
public static Entity.Teacher checkRoleLogin(string username, string password)
{
Entity.Teacher tch = new Entity.Teacher();
try
{
string sqlchekRole = " SELECT * FROM Teacher WHERE [email protected] AND [email protected]";
string Addvalue = "@user,@pass";
string value = username + "," + password;
ClassConnectDB conn = new ClassConnectDB();
SqlDataReader readCheckRole = conn.SelectWhereSqlDataReader(sqlchekRole, Addvalue, value);
if (readCheckRole.Read())
{
tch.Tch_ID = readCheckRole["Tch_ID"].ToString();
tch.Tch_Type = readCheckRole["Tch_Type"].ToString();
tch.Tch_FName = readCheckRole["Tch_FName"].ToString();
tch.Tch_LName = readCheckRole["Tch_LName"].ToString();
tch.Tch_username = readCheckRole["Tch_username"].ToString();
tch.Tch_password = readCheckRole["Tch_password"].ToString();
tch.Tch_picturepath = readCheckRole["Tch_picturepath"].ToString();
}
string iplog = Common.network.showIp();
string logdate = "CONVERT(VARCHAR(10), GETDATE(), 104)";
string logtime = "CONVERT(VARCHAR(8), GETDATE(), 108)";
string tid = readCheckRole["Tch_ID"].ToString();
string insertLog = "INSERT INTO LogLoginTeach(Log_IP, Log_Date, Log_timeStart, Tch_ID) VALUES('" + iplog + "'," + logdate + "," + logtime + "," + tid + ")";
conn.QueryExecuteNonQuery(insertLog);
conn.Close();
return tch;
}
catch (Exception)
{
return null;
}
}
示例8: checkRoleLogin
public static Entity.Employee checkRoleLogin(string username, string password)
{
try
{
Entity.Employee emp = new Entity.Employee();
string sqlchekRole = " SELECT * FROM Employee WHERE [email protected] AND [email protected]";
string Addvalue = "@user,@pass";
string value = username + "," + password;
ClassConnectDB conn = new ClassConnectDB();
SqlDataReader readCheckRole = conn.SelectWhereSqlDataReader(sqlchekRole, Addvalue, value);
if (readCheckRole.Read())
{
emp.Emp_ID = readCheckRole["Emp_ID"].ToString();
emp.Emp_Type = readCheckRole["Emp_Type"].ToString();
emp.Emp_LName = readCheckRole["Emp_LName"].ToString();
emp.Emp_FName = readCheckRole["Emp_FName"].ToString();
emp.Emp_username=readCheckRole["Emp_username"].ToString();
emp.Emp_password = readCheckRole["Emp_password"].ToString();
}
string iplog = Common.network.showIp();
string logdate = "CONVERT(VARCHAR(10), GETDATE(), 104)";
string logtime = "CONVERT(VARCHAR(8), GETDATE(), 108)";
string tid = readCheckRole["Emp_ID"].ToString();
string insertLog = "INSERT INTO LogLoginEmp(Log_IP, Log_Date, Log_timeStart, Emp_id) VALUES('" + iplog + "'," + logdate + "," + logtime + "," + tid + ")";
conn.QueryExecuteNonQuery(insertLog);
conn.Close();
return emp;
}
catch (Exception)
{
return null;
}
}
示例9: selectBranchNewsShowDetailNewsPage
public static Entity.BranchNewsInfo selectBranchNewsShowDetailNewsPage(string query)
{
ClassConnectDB conn = new ClassConnectDB();
Entity.BranchNewsInfo branchnews = new Entity.BranchNewsInfo();
try
{
string sql = "SELECT * FROM BranchNews WHERE [email protected]";
string Addvalue = "@id";
string value = query;
SqlDataReader drrShow = conn.SelectWhereSqlDataReader(sql, Addvalue, value);
if (drrShow.Read())
{
branchnews.BranchNews_Name = drrShow["BranchNews_Name"].ToString();
branchnews.Branch_Detail = drrShow["BranchNews_Detail"].ToString();
branchnews.Update_date = drrShow["Update_date"].ToString();
branchnews.Branch_Path = drrShow["BranchNews_Path"].ToString();
}
conn.Close();
return branchnews;
}
catch (Exception)
{
return null;
}
}
示例10: selectTrainingNewsShowDetailNewsPage
public static Entity.StudentNewsInfo selectTrainingNewsShowDetailNewsPage(string query)
{
ClassConnectDB conn = new ClassConnectDB();
Entity.StudentNewsInfo student = new Entity.StudentNewsInfo();
try
{
string sql = "SELECT * FROM StudentNews WHERE [email protected]";
string Addvalue = "@id";
string value = query;
SqlDataReader drrShow = conn.SelectWhereSqlDataReader(sql, Addvalue, value);
if (drrShow.Read())
{
student.StudentNews_Name = drrShow["StudentNews_Name"].ToString();
student.StudentNews_Detail = drrShow["StudentNews_Detail"].ToString();
student.Update_date = drrShow["Update_date"].ToString();
student.StudentNews_Path = drrShow["StudentNews_Path"].ToString();
}
conn.Close();
return student;
}
catch (Exception)
{
return null;
}
}
示例11: selectShowStdCheckNameSum
public static DataTable selectShowStdCheckNameSum(string dchID, string stdCode)
{
try
{
DataTable dt = new DataTable();
ClassConnectDB conn = new ClassConnectDB();
string sql = @"SELECT 'STUDENT' ,
( SELECT COUNT(CheckName_Num) as coou FROM EnrollIn INNER JOIN Student ON EnrollIn.Std_Campus_Code = Student.Std_Campus_Code INNER JOIN
CheckName ON EnrollIn.Enroll_ID = CheckName.Enroll_ID where [email protected] and [email protected] and CheckName_Status='S') as numSTD
,'LATE',
( SELECT COUNT(CheckName_Num) as coou FROM EnrollIn INNER JOIN Student ON EnrollIn.Std_Campus_Code = Student.Std_Campus_Code INNER JOIN
CheckName ON EnrollIn.Enroll_ID = CheckName.Enroll_ID where [email protected] and [email protected] and CheckName_Status='L') as numLate
,'NO_STD',
(SELECT COUNT(CheckName_Num) as coou FROM EnrollIn INNER JOIN Student ON EnrollIn.Std_Campus_Code = Student.Std_Campus_Code INNER JOIN
CheckName ON EnrollIn.Enroll_ID = CheckName.Enroll_ID where [email protected] and [email protected] and CheckName_Status='N') as numNosTd
,(SELECT COUNT(CheckName_Num) as coou FROM EnrollIn INNER JOIN Student ON EnrollIn.Std_Campus_Code = Student.Std_Campus_Code INNER JOIN
CheckName ON EnrollIn.Enroll_ID = CheckName.Enroll_ID where [email protected] and [email protected] ) as numall";
string addvalue = "@stdCode ,@dchid";
string value = stdCode + "," + dchID;
SqlDataReader drr = conn.SelectWhereSqlDataReader(sql, addvalue, value);
dt.Load(drr);
conn.Close();
return dt;
}
catch (Exception)
{
return null;
}
}
示例12: selectShowListViewMainHomeWork
public static DataTable selectShowListViewMainHomeWork(string classid, string dchid)
{
try
{
DataTable resultdt = new DataTable();
resultdt.Columns.Add("Homework_Name");
resultdt.Columns.Add("Create_date");
resultdt.Columns.Add("Create_time");
resultdt.Columns.Add("countuser");
resultdt.Columns.Add("Homework_Num");
resultdt.Columns.Add("Tch_Create");
string sqlselectNumcheckname = @" SELECT distinct hw.[Homework_Num] from Homework hw INNER JOIN
EnrollIn en ON hw.Enroll_ID = en.Enroll_ID INNER JOIN
DetailEducationOfStudent deu ON deu.DeEduStd=en.DeEduStd
where deu.EduStdID = '" + dchid + "'";
ClassConnectDB con = new ClassConnectDB();
SqlDataReader drrselectNumcheck = con.SelectSqlDataReader(sqlselectNumcheckname);
DataTable selectdt = new DataTable();
selectdt.Load(drrselectNumcheck);
if (selectdt.Rows.Count > 0)
{
foreach (DataRow roww in selectdt.Rows)
{
string num = roww[0].ToString();
string sqlselecthowork = @" SELECT distinct [Homework_Name]
,( SELECT distinct CONVERT(VARCHAR(12),Create_date, 106) FROM Homework INNER JOIN EnrollIn ON Homework.Enroll_ID = EnrollIn.Enroll_ID INNER JOIN
DetailEducationOfStudent dedu ON EnrollIn.DeEduStd= dedu.DeEduStd where (dedu.ClassRoom_ID = @classid ) AND ([email protected]))AS Create_date
,(SELECT distinct( CONVERT(CHAR(5), Create_date, 114)) FROM Homework INNER JOIN EnrollIn ON Homework.Enroll_ID = EnrollIn.Enroll_ID INNER JOIN
DetailEducationOfStudent dedu ON EnrollIn.DeEduStd= dedu.DeEduStd where (dedu.ClassRoom_ID = @classid) AND ([email protected]))as Create_time
,( SELECT count(Homework.Enroll_ID) FROM Homework INNER JOIN EnrollIn ON Homework.Enroll_ID = EnrollIn.Enroll_ID INNER JOIN
DetailEducationOfStudent dedu ON EnrollIn.DeEduStd= dedu.DeEduStd where (dedu.ClassRoom_ID = @classid) AND ([email protected]) AND (Homework_Status='Y')) AS countuser
,[Homework_Num]
,[Tch_Create]
FROM [Homework] where Homework_Num = @num ";
string addvalue = "@classid,@num";
string value = classid + "," + num;
SqlDataReader drr = con.SelectWhereSqlDataReader(sqlselecthowork, addvalue, value);
DataTable dtt = new DataTable();
dtt.Load(drr);
foreach (DataRow roo in dtt.Rows)
{
resultdt.Rows.Add(roo[0].ToString(), roo[1].ToString(), roo[2].ToString(), roo[3].ToString(), roo[4].ToString(), roo[5].ToString());
}
}
}
return resultdt;
}
catch (Exception)
{
return null;
}
}
示例13: searchSubjectRecusiveTest
public static DataTable searchSubjectRecusiveTest(string p)
{
try
{
string sql = @"SELECT *
FROM [WEBCSDB].[dbo].[StructSubject]
where StructSub_Code='"+p+"'";
string Addvalue = "@p";
string value = p;
ClassConnectDB conn=new ClassConnectDB();
SqlDataReader dr = conn.SelectWhereSqlDataReader(sql,Addvalue,value);
DataTable dt = new DataTable();
dt.Load(dr);
return dt;
}
catch (Exception)
{
return null;
}
}
示例14: loadAllShowGridePageSubject
public static DataTable loadAllShowGridePageSubject(string code)
{
if (!code.Equals(""))
{
SqlDataReader drrsub;
string sqlString = "";
ClassConnectDB conn = new ClassConnectDB();
try
{
string sqlfollowSubject = "SELECT DISTINCT StructSub_CodePass FROM FollowSubject WHERE [email protected]";
string Addvalue = "@code";
string value = code;
SqlDataReader drr = conn.SelectWhereSqlDataReader(sqlfollowSubject, Addvalue, value);
sqlString = @"SELECT *
FROM StructSubject
where ";
int i = 1;
while (drr.Read())
{
if (i == 1)
{
sqlString += " StructSub_Code='" + drr["StructSub_CodePass"].ToString() + "'";
}
else
{
sqlString += " or StructSub_Code='" + drr["StructSub_CodePass"].ToString() + "'";
}
i++;
}
drrsub = conn.SelectSqlDataReader(sqlString);
DataTable dt = new DataTable();
dt.Load(drrsub);
return dt;
conn.Close();
}
catch (Exception)
{
return null;
}
}
else
{
return null;
}
}
示例15: selectLoadShowSubject
public static Entity.CurriculumInfo selectLoadShowSubject(string code)
{
try
{
string sql = "SELECT * FROM StructSubject Where [email protected]";
string Addvalue = "@code";
string value = code;
Entity.CurriculumInfo sub = new Entity.CurriculumInfo();
ClassConnectDB conn=new ClassConnectDB();
SqlDataReader read = conn.SelectWhereSqlDataReader(sql,Addvalue,value);
if (read.Read()) {
sub.StructSub_Code = read["StructSub_Code"].ToString();
sub.StructSub_NameTha=read["StructSub_NameTha"].ToString();
sub.StructSub_NameEn=read["StructSub_NameEn"].ToString();
sub.StructSub_Detail=read["StructSub_Detail"].ToString();
sub.StructSub_Credit = read["StructSub_Credit"].ToString();
// sub.Curri_Year = read["Curri_Id"].ToString();
}
string sqlCurri = "SELECT * FROM Curriculum Where [email protected]";
string addCurri = "@curid";
string valueCurri = read["Curri_Id"].ToString();
SqlDataReader readCurri = conn.SelectWhereSqlDataReader(sqlCurri,addCurri,valueCurri);
if (readCurri.Read()) {
sub.Curri_Year = readCurri["Curri_Year"].ToString();
sub.Curri_Course = readCurri["Curri_Course"].ToString();
sub.Curri_Group = readCurri["Curri_Group"].ToString();
}
return sub;
}
catch (Exception)
{
return null;
}
}