Click here to Skip to main content
15,894,539 members

Comments by Atta Ur Rahman 118 (Top 29 by date)

Atta Ur Rahman 118 23-Mar-19 9:02am View    
Thanks.
Atta Ur Rahman 118 23-Mar-19 9:02am View    
Thank You Sir. It Works. My database is connected to my Project.
Atta Ur Rahman 118 1-May-15 8:50am View    
private void bt_requesting_Click(object sender, EventArgs e)
{
string requestappoint = combo_requstinpersonappoint.SelectedItem.ToString();
string requestpersonname = tb_requestingpersnname.Text.Trim();
string relation = tb_relation.Text.Trim();
string patientname = tb_patntnmae.Text.Trim();
string adres = tb_address.Text.Trim();
string city = tb_city.Text.Trim();
string cell = tb_cell.Text.Trim();
string patienttype = comboBox_patienttype.SelectedItem.ToString();
string apointtype = comboBox_appointtype.SelectedItem.ToString();
DateTime date = DateTime.Parse(desirdate.EditValue.ToString());
DateTime time = DateTime.Parse(desiretime.EditValue.ToString());
string insert = string.Format("insert into appointment values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}')", requestappoint, requestpersonname, relation, patientname, adres, city, cell, patienttype, patienttype, desirdate, desiretime);
SqlCommand cmd = new SqlCommand(insert, dbcs.open());
cmd.ExecuteNonQuery();
MessageBox.Show("Request Complete");
}
code is this.
I think the error is in this line (DateTime time = DateTime.Parse(desiretime.EditValue.ToString());)
Atta Ur Rahman 118 1-May-15 8:49am View    
private void bt_requesting_Click(object sender, EventArgs e)
{
string requestappoint = combo_requstinpersonappoint.SelectedItem.ToString();
string requestpersonname = tb_requestingpersnname.Text.Trim();
string relation = tb_relation.Text.Trim();
string patientname = tb_patntnmae.Text.Trim();
string adres = tb_address.Text.Trim();
string city = tb_city.Text.Trim();
string cell = tb_cell.Text.Trim();
string patienttype = comboBox_patienttype.SelectedItem.ToString();
string apointtype = comboBox_appointtype.SelectedItem.ToString();
DateTime date = DateTime.Parse(desirdate.EditValue.ToString());
DateTime time = DateTime.Parse(desiretime.EditValue.ToString());
string insert = string.Format("insert into appointment values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}')", requestappoint, requestpersonname, relation, patientname, adres, city, cell, patienttype, patienttype, desirdate, desiretime);
SqlCommand cmd = new SqlCommand(insert, dbcs.open());
cmd.ExecuteNonQuery();
MessageBox.Show("Request Complete");
}

Code is this
Atta Ur Rahman 118 1-May-15 8:24am View    
private void bt_requesting_Click(object sender, EventArgs e)
{
string requestappoint = combo_requstinpersonappoint.SelectedItem.ToString();
string requestpersonname = tb_requestingpersnname.Text.Trim();
string relation = tb_relation.Text.Trim();
string patientname = tb_patntnmae.Text.Trim();
string adres = tb_address.Text.Trim();
string city = tb_city.Text.Trim();
string cell = tb_cell.Text.Trim();
string patienttype = comboBox_patienttype.SelectedItem.ToString();
string apointtype = comboBox_appointtype.SelectedItem.ToString();
DateTime date = DateTime.Parse(desirdate.EditValue.ToString());
DateTime time = DateTime.Parse(desiretime.EditValue.ToString());
string insert = string.Format("insert into appointment values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}')", requestappoint, requestpersonname, relation, patientname, adres, city, cell, patienttype, patienttype, desirdate, desiretime);
SqlCommand cmd = new SqlCommand(insert, dbcs.open());
cmd.ExecuteNonQuery();
MessageBox.Show("Request Complete");
}
Sir it is Full Code