| | |
SQL Database loop
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2006
Posts: 13
Reputation:
Solved Threads: 0
Hello guys,
I have a Calendar control that I am working on. I am having problems with the appointment portion of it. Everytime you click on a time slot and type, it adds an appintment. Here is the code I use to add the appointment.
Right now I have the appointments saved to a database that I have entered. The only problem is that after the program closes it doesnt save the appointments but they are in the database.
Is there a way to get the appointments at the start of the program?
I was thinking about getting the number of records int he database and put it in the interger "records" and then do a for loop to to add the appointments until the end of the records is complete. something like this.
This will add them back to the form on start but how do I specify what StartDate, EndDate and Title are for each iteration through the records? I am kinda new to SQL.
I have a Calendar control that I am working on. I am having problems with the appointment portion of it. Everytime you click on a time slot and type, it adds an appintment. Here is the code I use to add the appointment.
Appointment m_Appointment = newAppointment(); m_Appointment.StartDate = m_Date; m_Appointment.EndDate = enddate; m_Appointment.Title = "test"; m_Appointments.Add(m_Appointment);
Right now I have the appointments saved to a database that I have entered. The only problem is that after the program closes it doesnt save the appointments but they are in the database.
Is there a way to get the appointments at the start of the program?
I was thinking about getting the number of records int he database and put it in the interger "records" and then do a for loop to to add the appointments until the end of the records is complete. something like this.
for (int i = 0; i < records; i++)
{
Appointment m_Appointment = newAppointment();
m_Appointment.StartDate = m_Date;
m_Appointment.EndDate = enddate;
m_Appointment.Title = "test";
m_Appointments.Add(m_Appointment);
}This will add them back to the form on start but how do I specify what StartDate, EndDate and Title are for each iteration through the records? I am kinda new to SQL.
Last edited by chuck577; Dec 7th, 2006 at 6:33 pm.
•
•
•
•
I did a little more research and found that I was going about this all wrong. I am going to use a DataSet and that should do what I need done here.
Thanks
if you need a specific start date /end date that depends on the SQL server but the generic and commonly excepted way could be
select [some column],[somecolumn],[somecolumn]...etc
from [name of database]
where [name of date column] between 'dd-mmm-yyyy' and 'dd-mmm-yyyy';
my syntax may be off though.
Last edited by Killer_Typo; Dec 8th, 2006 at 4:36 am.
Dont forget to spread the reputation to those that deserve!
![]() |
Similar Threads
- add nodes and subnodes to a treeview from sql database by coding in asp.net 2.0 (ASP.NET)
- Adding a column to an SQL database (VB.NET)
- Update SQL database automatically using VB6 (Visual Basic 4 / 5 / 6)
- Insert into sql database (ASP.NET)
- Process very slow - SQL Database (MS SQL)
- Help with Roles Stored in SQL database (ASP.NET)
- Snyc'n Local SQL database online (MS SQL)
Other Threads in the C# Forum
- Previous Thread: HELP~! how to call Matlab function in C#?
- Next Thread: How can i solve the COMException problem
| Thread Tools | Search this Thread |
.net access algorithm api array asp.net barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom database databaseconnection datagrid datagridview dataset datetime dbconnection degrees design development draganddrop drawing encryption enum eventhandlers excel file firefox form format forms function gdi+ grantorrevokepermissionthroughc#.net image index input install java label libraries list listbox loop mandelbrot marshalbyrefobject math mouseclick movingimage mysql netcfsvcutil.exe operator path photoshop php picturebox pixelinversion platform post programming radians regex remoting resourcefile richtextbox server sleep socket sql statistics stream string study system.servicemodel table tcpclientchannel text textbox thread time timer update usercontrol validation visualstudio webbrowser windows winforms wpf wpfc# xml





