got it to fill all fields
This commit is contained in:
@@ -55,6 +55,15 @@ namespace CH78
|
||||
txtStuID.Text = ds.Tables[0].Rows[0]["student_id"].ToString();
|
||||
txtFNAME.Text = ds.Tables[0].Rows[0]["fname"].ToString();
|
||||
txtLNAME.Text = ds.Tables[0].Rows[0]["lname"].ToString();
|
||||
txtMidInit.Text = ds.Tables[0].Rows[0]["midinit"].ToString();
|
||||
txtDOB.Text = ds.Tables[0].Rows[0]["DOB"].ToString();
|
||||
txtActBal.Text = ds.Tables[0].Rows[0]["ACCT_BAL"].ToString();
|
||||
txtMajor.Text = ds.Tables[0].Rows[0]["MAJOR"].ToString();
|
||||
txtCellPhone.Text = ds.Tables[0].Rows[0]["CELL_PHONE"].ToString();
|
||||
txtAdr1.Text = ds.Tables[0].Rows[0]["ADDRESS_ONE"].ToString();
|
||||
txtCity.Text = ds.Tables[0].Rows[0]["CITY"].ToString();
|
||||
txtZip.Text = ds.Tables[0].Rows[0]["ZIP"].ToString();
|
||||
txtCreds.Text = ds.Tables[0].Rows[0]["TOTALCREDITS"].ToString();
|
||||
// TODO complete other fields
|
||||
|
||||
gender = ds.Tables[0].Rows[0]["GENDER"].ToString().Trim();
|
||||
@@ -78,6 +87,12 @@ namespace CH78
|
||||
txtState.SelectedValue = "1";
|
||||
txtState.DataBind();
|
||||
|
||||
txtGender.DataSource = StudentDataTier.GetGenders();
|
||||
txtGender.DataTextField = "CommonName";
|
||||
txtGender.DataValueField = "Gender_ID";
|
||||
txtGender.SelectedValue = "0";
|
||||
txtGender.DataBind();
|
||||
|
||||
// txtState.SelectedValue = ds.Tables[0].Rows[0]["state"].ToString();
|
||||
if (type.ToUpper() == "VIEW")
|
||||
{
|
||||
|
@@ -103,6 +103,42 @@ namespace CH78
|
||||
myConn.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public static DataSet GetGenders()
|
||||
{
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
// open connection
|
||||
myConn.Open();
|
||||
//clear any parameters
|
||||
cmdString.Parameters.Clear();
|
||||
// command
|
||||
cmdString.Connection = myConn;
|
||||
cmdString.CommandType = CommandType.StoredProcedure;
|
||||
cmdString.CommandTimeout = 1500;
|
||||
cmdString.CommandText = "GetAllGenders";
|
||||
// adapter and dataset
|
||||
SqlDataAdapter aAdapter = new SqlDataAdapter();
|
||||
aAdapter.SelectCommand = cmdString;
|
||||
DataSet aDataSet = new DataSet();
|
||||
|
||||
// fill adapter
|
||||
aAdapter.Fill(aDataSet);
|
||||
|
||||
// return dataSet
|
||||
return aDataSet;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ArgumentException(ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
myConn.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public static DataSet SearchStudents(string fname, string lname, string stuID)
|
||||
{
|
||||
|
Reference in New Issue
Block a user