Hi all,
I have an error msg show that:-
Error 5 The name 'rdpDate' does not exist in the current context
if i declare this radDatePicker, another error msg will display which is:-
Error 5 'System.DateTime' does not contain a definition for 'Value' and no extension method 'Value' accepting a first argument of type 'System.DateTime' could be found (are you missing a using directive or an assembly reference?)
Any help is appreciated....
Best regards,
Nasri
protected void btnSignUp_Click(object sender, EventArgs e)
{
try
{
string guid = System.Guid.NewGuid().ToString();
System.Guid g = new Guid(guid);
string txtName = (fvwSignUp.Row.FindControl("txtName") as TextBox).Text;
string txtEmail = (fvwSignUp.Row.FindControl("txtEmail") as TextBox).Text;
string txtPassword = (fvwSignUp.Row.FindControl("txtPassword") as TextBox).Text;
string rcbGender = (fvwSignUp.Row.FindControl("rcbGender") as RadComboBox).SelectedValue;
// DateTime rdpDate = (fvwSignUp.Row.FindControl("rdpDate") as RadDatePicker).SelectedDate;
strConnection = ConfigurationManager.ConnectionStrings["pfms"].ConnectionString;
dbConn = new SqlConnection(strConnection);
dbConn.Open();
SqlCommand da = new SqlCommand("insert into SignUp values(@UserID,@UserName,@Email,@Password,@Gender,@BirthDate)", dbConn);
da.Parameters.Add("@UserID", SqlDbType.VarChar, 200).Value =guid;
da.Parameters.Add("@UserName", SqlDbType.VarChar).Value = txtName;
da.Parameters.Add("@Email", SqlDbType.VarChar).Value = txtEmail;
da.Parameters.Add("@Password", SqlDbType.VarChar).Value = txtPassword;
da.Parameters.Add("@Gender", SqlDbType.Int).Value = rcbGender;
SqlParameter p1 = da.Parameters.Add("@BirthDate", SqlDbType.DateTime);
p1.Value = rdpDate.Value;
// DateTime dMyDate = rdpDate.Value;
da.ExecuteNonQuery();
fvwSignUp.ChangeMode(FormViewMode.ReadOnly);
}
finally
{
if (dbConn != null)
{
dbConn.Close();
bindData();
}
}
Error 5 The name 'rdpDate' does not exist in the current context
if i declare this radDatePicker, another error msg will display which is:-
Error 5 'System.DateTime' does not contain a definition for 'Value' and no extension method 'Value' accepting a first argument of type 'System.DateTime' could be found (are you missing a using directive or an assembly reference?)
Any help is appreciated....
Best regards,
Nasri