E
Eugene Anthony
Connection code:
SqlConnection cnn = new
SqlConnection(ConfigurationManager.ConnectionStrings["myConnection"].Con
nectionString);
SqlCommand myCommand = new SqlCommand();
myCommand.Connection = cnn;
myCommand.CommandText = "SELECT * FROM Authentication WHERE
AuthenticationID=1";
myCommand.CommandType = CommandType.Text;
SqlDataAdapter myAdapter = new SqlDataAdapter(myCommand);
DataSet ds = new DataSet();
myAdapter.Fill(ds, "Authentication");
ds.Tables[0].Rows[0].ItemArray.GetValue(0).ToString();
My dropdownlist control:
<aspropDownList ID="DropDownList1" runat="server">
<asp:ListItem>Enabled</asp:ListItem>
<asp:ListItem>Disabled</asp:ListItem>
</aspropDownList>
Lets say ds.Tables[0].Rows[0].ItemArray.GetValue(5).ToString(); returns
"Disabled", how do I display it on my dropdownlist?
Eugene Anthony
SqlConnection cnn = new
SqlConnection(ConfigurationManager.ConnectionStrings["myConnection"].Con
nectionString);
SqlCommand myCommand = new SqlCommand();
myCommand.Connection = cnn;
myCommand.CommandText = "SELECT * FROM Authentication WHERE
AuthenticationID=1";
myCommand.CommandType = CommandType.Text;
SqlDataAdapter myAdapter = new SqlDataAdapter(myCommand);
DataSet ds = new DataSet();
myAdapter.Fill(ds, "Authentication");
ds.Tables[0].Rows[0].ItemArray.GetValue(0).ToString();
My dropdownlist control:
<aspropDownList ID="DropDownList1" runat="server">
<asp:ListItem>Enabled</asp:ListItem>
<asp:ListItem>Disabled</asp:ListItem>
</aspropDownList>
Lets say ds.Tables[0].Rows[0].ItemArray.GetValue(5).ToString(); returns
"Disabled", how do I display it on my dropdownlist?
Eugene Anthony