15,884,237 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 9413472 (Top 25 by date)
Member 9413472
24-Sep-12 10:36am
View
Hi sandeep thanks for your reply
Is there any other way without using XMLHttprequest. I have just place the treeview control, added player control called ASPNetAudio.NET3 I have also added mp3 files in my project to particular folder init.I didnt do any coding yet.
Could you please suggest.
Thank you
Member 9413472
24-Sep-12 10:33am
View
I have just place the treeview control, added player control called ASPNetAudio.NET3 I have also added mp3 files in my project to particular folder init.I didnt do any coding yet.
Could you please suggest.
Thank you
Member 9413472
21-Sep-12 12:20pm
View
Yes Thank you for your answer What I am doing over here is m using two datatable anf then getting one column from the first datatable and two columns from the second datatable depending on the first one.Is this the correct way I have done in my coding? If no then Can you please give me what should be the better solution for this?
Thank you
Member 9413472
21-Sep-12 12:06pm
View
hello
here is my code now
private void creategvreceptionist()
{
string[] values;
DataTable dtreceptionisttmslot = (DataTable)cnt.GetRecord("select first_appointment_time from tblValidAppointmentTime ");
if (dtreceptionisttmslot != null && dtreceptionisttmslot.Rows.Count > 0)
{
values =new string[dtreceptionisttmslot.Rows.Count];
foreach (DataRow row in dtreceptionisttmslot.Rows)
{
//DataTable dtreceptionist = (DataTable)cnt.GetRecord("SELECT p.id,p.fname,p.lname,p.DOB,v.facility_name,v.provider_name,v.first_appointment_time,v.tmslot_id,v.timeslot_id,e.pc_pid, e.pc_eid, e.pc_aid, e.pc_title, e.pc_eventDate, e.pc_startTime, e.pc_hometext, u.fname, u.lname, u.mname FROM tblPatientData AS p,tblValidAppointmentTime AS v,tblOpenemrPostcalendarEvents AS e, tblUsers AS u WHERE e.pc_eventDate >= '" + DateTime.Now.ToShortDateString() + "' AND u.id = e.pc_aid AND p.id=e.pc_pid AND e.pc_tmslot_id=v.tmslot_id ");
string q = "select fname,DOB from tblPatientData";
DataTable dtreceptionist = (DataTable)cnt.GetRecord(q);
if (dtreceptionist.Rows.Count > 0)
{
foreach (DataRow arow in dtreceptionist.Rows)
{
values[0] = row["first_appointment_time"].ToString();
values[1] = arow["fname"].ToString();
values[2] = arow["DOB"].ToString();
dtreceptionisttmslot.Rows.Add(values);
}
}
else
{
values[0] = row["time"].ToString();
values[1] = null;
values[2] = null;
//dtreceptionisttmslot.Rows.Add();
}
}
}
dtreceptionisttmslot.AcceptChanges();
gvreceptionist.DataSource = dtreceptionisttmslot;
gvreceptionist.DataBind();
}
when i am adding the value with the line dttimeslottmslot.row.add(values) that line shows me an error input array is longer than the columns in this table
Member 9413472
21-Sep-12 11:57am
View
hello marcus
Thank for your answer i have use your above approach but still its getting me that error. Do you have any solution.
Member 9413472
21-Sep-12 11:21am
View
see My code is like this
private void creategvreceptionist()
{
//int value = 0;
//DataTable mdt= new DataTable();
string[] values = new string[3];
//string[] values1;
DataTable dtreceptionisttmslot = (DataTable)cnt.GetRecord("select first_appointment_time from tblValidAppointmentTime ");
foreach (DataRow row in dtreceptionisttmslot.Rows)
{
//DataTable dtreceptionist = (DataTable)cnt.GetRecord("SELECT p.id,p.fname,p.lname,p.DOB,v.facility_name,v.provider_name,v.first_appointment_time,v.tmslot_id,v.timeslot_id,e.pc_pid, e.pc_eid, e.pc_aid, e.pc_title, e.pc_eventDate, e.pc_startTime, e.pc_hometext, u.fname, u.lname, u.mname FROM tblPatientData AS p,tblValidAppointmentTime AS v,tblOpenemrPostcalendarEvents AS e, tblUsers AS u WHERE e.pc_eventDate >= '" + DateTime.Now.ToShortDateString() + "' AND u.id = e.pc_aid AND p.id=e.pc_pid AND e.pc_tmslot_id=v.tmslot_id ");
string q = "select fname,DOB from tblPatientData";
DataTable dtreceptionist = (DataTable)cnt.GetRecord(q);
if (dtreceptionist.Rows.Count > 0)
{
foreach (DataRow arow in dtreceptionist.Rows)
{
//DataRow brow = dtreceptionist.NewRow();
//arow["fname"] = dtreceptionist.Rows[0][1];
//brow["patient name"] = dtreceptionist.Rows[0][2];
values[0] = row["first_appointment_time"].ToString();
//values[1] = row["tmslot_id"].ToString();
values[1]= arow["fname"].ToString();
values[2]= arow["DOB"].ToString();
//values[4] = arow["pc_pid"].ToString();
dtreceptionist.Rows.Add(values);
}
}
else
{
values[0] = row["time"].ToString();
values[1] = null;
values[2] = null;
//dtreceptionisttmslot.Rows.Add();
}
}
dtreceptionisttmslot.AcceptChanges();
gvreceptionist.DataSource = dtreceptionisttmslot;
gvreceptionist.DataBind();
}
still its getting me that error saying input array is longer than the columns in this table
Member 9413472
21-Sep-12 11:11am
View
Deleted
Thank you can you explain this in my example its saying me that input array is longer that the columns in this table?
Member 9413472
21-Sep-12 10:50am
View
thanks
Member 9413472
21-Sep-12 10:49am
View
Hey Sandeep sorry ignore earlier comment , please could you specify how i can initialize the variable to hold the three values. Thanks
Member 9413472
21-Sep-12 10:47am
View
Hey Sandeep,
I have defined the variable initially
{
//int value = 0;
//DataTable mdt;
//DataRow mrow;
string[] values;
//string[] values1;
DataTable dtreceptionisttmslot = (DataTable)cnt.GetRecord("select first_appointment_time , tmslot_id from tblValidAppointmentTime ");
Member 9413472
21-Sep-12 10:41am
View
yes, how am I suppose to be adding the value please advise.
Member 9413472
20-Sep-12 9:48am
View
i need those lable value from database table i dont need just header text how can i do that?
Member 9413472
13-Sep-12 10:52am
View
no it is not working..
Member 9413472
13-Sep-12 10:29am
View
and one more thing is while checking the start time and endtime in the while loop it if for eg user has given 12:00 start time and 5:00 as end time it is by default taking starttime as PM and endtime as AM. may be that is the reason why it is not getting in to the loop.
and yeah you can give me your code as solution if you trying at your end i will make changes as per your solution in my code to see if it is working or not.
Thank you
Member 9413472
13-Sep-12 10:22am
View
sorry but m new to this forum..but let me know where you made this changes?
Member 9413472
13-Sep-12 10:09am
View
i want to create timeslots of 15 minutes timeintervals based on the timing starttime and endtime which we have to fetch from the database. and then I want to store all the time slots in to another table of the database.
basically i have appointment page in that i want 15 minutes timeslots for appointment and i want to fetch those time slots from the database so based on the doctors shift timing which is stored in the database with starttime and endtime we have to generate time slots of lets say 15 minutes.
my concept is this and i have tried a lot but m not getting the things right i guess.
thank you for your help
Member 9413472
13-Sep-12 9:28am
View
let me put my code
DataTable dttimeslot = (DataTable)cnt.GetRecord("Select day_start_time,day_end_time,facility_name,duration,provider_name from tblTimeSlots where facility_name='" + lsbcrlocation.Items[i].Text + "' and provider_name='" + lsbcrprovider.Items[j].Text + "'");
here i am calling the class getrecord to fetch the data from the database
now
DateTime stime =Convert.ToDateTime(dttimeslot.Rows[0]["day_start_time"].ToString());
DateTime etime =Convert.ToDateTime(dttimeslot.Rows[0]["day_end_time"].ToString());
string duration = dttimeslot.Rows[0]["duration"].ToString();
this is what i did as u suggest me
then
DateTime startTime = DateTime.Today.AddHours(stime.Hour);
DateTime endTime = DateTime.Today.AddHours(etime.Hour).AddMinutes(etime.Minute);
while (startTime < endTime)
{
timeList.Add(startTime.ToShortTimeString());
startTime = startTime.AddMinutes(inc);
lbltimeslots.Text += startTime.ToShortTimeString();
hrcls.upindel("insert into tblValidAppointmentTime(facility_name,provider_name,first_appointment_time) values('" + lsbcrlocation.Items[i].Text + "','" + lsbcrprovider.Items[j].Text + "','" + lbltimeslots.Text + "')");
//.ToShortTimeString();
}
but this is not going in to that loop and yeah its not taking starttime and endtime as format of time it is taking whole date and time while debugging i have check that
could you have solution with this?
thank you
Member 9413472
13-Sep-12 8:55am
View
like i have stime variable which has value from the database in the datetime format. i need only hours and minutes from that value so how can i get that with datetime.today.addhours()?
Member 9413472
13-Sep-12 8:16am
View
could somebody help me with the solution?
Member 9413472
13-Sep-12 8:15am
View
Deleted
do you have solution for this?
Member 9413472
13-Sep-12 8:03am
View
no actually I have the string value here below
string stime = dttimeslot.Rows[0]["day_start_time"].ToString();
i need that stime into
DateTime startTime = DateTime.Today.AddHours("what should be over here"(stime)).addminute;
the stime variable from the database and it has datetime datatype
how can i get those value from the database
Member 9413472
12-Sep-12 15:03pm
View
we are trying to create time slots based on the starttime and endtime given in the textbox in asp.net.we need time interval of 20 minutes.andi need those timeslots get stored in the sql server database table.i am using c#
Member 9413472
12-Sep-12 14:54pm
View
thank you so much for your advice do you hsve any solution for my question?
Member 9413472
12-Sep-12 14:53pm
View
i have created an object of class file which hrcls.upindel that will contain connectionstring and all.
Member 9413472
12-Sep-12 14:45pm
View
for (int i = 0; i < lsbcrlocation.Items.Count; i++)
{
for (int j = 0; j < lsbcrprovider.Items.Count; j++)
{
if (lsbcrlocation.Items[i].Selected == true && lsbcrprovider.Items[j].Selected == true)
{
//string facility_name = ((Label)gvdisplaytimeslots.SelectedRow.FindControl("lblLocation")).Text;
//string provider_name = ((Label)gvdisplaytimeslots.SelectedRow.FindControl("lblProvider")).Text;
//HiddenField hfid = ((HiddenField)gvdisplaytimeslots.SelectedRow.FindControl("hfid"));
DataTable dttimeslot = (DataTable)cnt.GetRecord("Select day_start_time,day_end_time,facility_name,duration,provider_name from tblTimeSlots where facility_name='" + lsbcrlocation.Items[i].Text + "' and provider_name='" + lsbcrprovider.Items[j].Text + "'");
string stime = dttimeslot.Rows[0]["day_start_time"].ToString();
string etime = dttimeslot.Rows[0]["day_end_time"].ToString();
string duration = dttimeslot.Rows[0]["duration"].ToString();
//Datetime stattime= Convert.ToDateTime()
DateTime startTime = DateTime.Today.AddHours(Convert.ToInt16(stime));
// System.Diagnostics.Debug.Print(startTime.ToShortTimeString());
DateTime endTime = DateTime.Today.AddHours(Convert.ToInt16(etime)).AddMinutes(00);
//System.Diagnostics.Debug.Print(endTime.ToShortTimeString());
int inc = Convert.ToInt16(duration);
List<string> timeList = new List<string>();
lbltimeslots.Text = "";
while (startTime < endTime)
{
timeList.Add(startTime.ToShortTimeString());
startTime = startTime.AddMinutes(inc);
lbltimeslots.Text += startTime.ToShortTimeString();
hrcls.upindel("insert into tblValidAppointmentTime(facility_name,provider_name,first_appointment_time) values('" + lsbcrlocation.Items[i].Text + "','" + lsbcrprovider.Items[j].Text + "','" + lbltimeslots.Text + "')");
//.ToShortTimeString();
}
timeList.Add(endTime.ToShortTimeString());
}
}
}
}
I have tried with this in the above code i want to store calculated time slots in the tblvalidappointmenttime table which i have created in sql server
Show More