Can anyone please tell me how to store the appointment properties like label,resources,contacts,etc in the database and retriewve it through code( not using tableadapter).
C1_IrinaP32p said 2 years, 8 months ago:
By default C1Scheduler persists all appointment properties in xml format into your data source if you set mapping for AppointmentProperties (it should be big text field). You can implement other logic, but we have no such samples.
I'm not sure that I understand what do you mean by "retreive through code". Look at Appointment class documentation – there is a description for every property.
Sorry i didnt see the property for giving mapping name for properties. I am retrieving the data from database using the below code,
dim ds_appointment as new dataset
dim da_appointment as new mysqldataadapter("select * from appointments",myconnection)
dim dt as new datatable
Me.C1Schedule1.DataStorage.AppointmentStorage.DataMember = "Appointments" Me.C1Schedule1.DataStorage.AppointmentStorage.DataSource = ds_appointment Me.C1Schedule1.DataStorage.AppointmentStorage.Mappings.Body.MappingName = "Body" Me.C1Schedule1.DataStorage.AppointmentStorage.Mappings.End.MappingName = "End" Me.C1Schedule1.DataStorage.AppointmentStorage.Mappings.IdMapping.MappingName = "Id" Me.C1Schedule1.DataStorage.AppointmentStorage.Mappings.Location.MappingName = "Location" Me.C1Schedule1.DataStorage.AppointmentStorage.Mappings.Start.MappingName = "Start" Me.C1Schedule1.DataStorage.AppointmentStorage.Mappings.Subject.MappingName = "Subject"
While retrieving there is no problem. Because while testing i have manually entered the data into database. Now my problem hpw should i insert the data into database programatically, ie, i want to use like,
Dim cmd_status As New MySqlCommand(query, myconnection)
result_manipulation = cmd_status.ExecuteNonQuery()
In query i want to write insert statement,
query="Insert into appointments(id,body,end,start,location,subject,property) values()
In which event can i get the body,start,end,etc values? and how to create the property value? IS it mandatory that a unique id should be generated for ID field?
Sorry, i am new to component one. this is the first time i am using it. If i write it in appointment_added event will it be correct?
How to create the property field in XML field.can i create it manually using the property tags, if so is their any order to write the properties in XML format?
C1_IrinaP32p said 2 years, 7 months ago:
You should have one more varchar column in your database. The mapping should look like this:
Look at your code :
You have DataSet and "appointments" DataTable. Your "appointments" DataTable contains all data you need to save them into underlying database. I.e. you should take column value and use it as a SqlCommand parameter. You can use either C1Schedule.AppointmentAdded, etc.. events, or DataTable events.Answer
sweish said 2 years, 7 months ago:
Thank you so much.. Forum is excellent.. Thanks for the immediate reply
You must be logged in to reply to this topic.