i wanna create an application staff in time out time calculation,
so i show the staff_id,staff_name in repeater which has already stored in database,ve to insert only datetime with in the repeater so i made code for repeater.
in database table:
------------------------
create table datet
(
Cust_id int identity,
cus_name varchar(200),
dateF datetime
)
insert into datet (cus_name) values ('ram')
insert into datet (cus_name) values ('sam')
in asp.net:
------------
My C# Code:
----------
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["AccessConnectionString"].ConnectionString);
protected void Page_Load(object sender, EventArgs e)
{
BindGrid();
}
private void BindGrid()
{
SqlDataAdapter sqlAdp = new SqlDataAdapter("Select cust_Id,Cus_name,dateF from datet ", conn);
DataTable dt = new DataTable();
sqlAdp.Fill(dt);
Rep.DataSource = dt;
Rep.DataBind();
}
protected void Button1_Click(object sender, EventArgs e)
{
string query = "";
conn.Open();
foreach (RepeaterItem item in Rep.Items)
{
TextBox cust_id = (TextBox)item.FindControl("cust_id");
TextBox Cus_name = (TextBox)item.FindControl("Cus_name");
TextBox datetimepicker = (TextBox)item.FindControl("dateF");
query = "insert into datet values(cust_id='" + @cust_id + "',Cus_name='" + @Cus_name + "',dateF='" + datetimepicker.Text + "')";
SqlCommand cmd = new SqlCommand(query, conn);
cmd.ExecuteNonQuery();
}
}
here my problem is when i use the datetime picker outside of the repeater control its showing calender and time , inside the repeater it was not working?????
how to solve?
how to solve?
Rocky RockyPosted Aug 20, 2014, 11:49 PM
After Change The script ALso The Date time Picker Not Working
Thanks
Rocky
Ramesh MaruthiPosted Aug 20, 2014, 10:45 AM
$('#datetimepicker').datetimepicker({
dayOfWeekStart: 1
});
to this