Jump to content
Xtreme .Net Talk

pendragon

Avatar/Signature
  • Posts

    214
  • Joined

  • Last visited

Everything posted by pendragon

  1. Hi I am copying records from one table to another using the ImportRow command, this works ok but when I tried to add the records to the database nothing happened, This I believe is due to the fact that ImportRow copies all the state information into the new table so Insert does not think it has anything to do. I can live with that as I have to set a flag on each record to say where it came from. The problem is when I call my insert records routine it thinks that it has to run an UPDATE command and not an INSERT command so I get the error Update requires a valid update command. Does anyone know how to get over this apart from doing it the long way by adding a newrow and setting each column individually?, which works but I have 7 tables to copy from and was hoping to do it in a single routine. Thanks
  2. We prefer the term Grown Up :D
  3. Thanks Nerseus, now I also understand what the defaultview option is used for and how it is accessed. When I was learning ADO.NET (and am by no means an expert yet as I think has just been proved) I brought the Microsoft ADO.NET core reference book and I don't believe that this way of doing it is even mentioned, I wonder how many other things I am doing that can be done in a simpler way :confused:
  4. Hi EFileTahi-A Must admit never used the table.dataview.sort method before maybe this only works when data binding. Anyway the following works. DataView dv = new DataView(this.dtTemp); dv.Sort = "Items ASC"; DataRowView row; for (int i = 0; i < dv.Count; i++) { row = dv[i]; this.listBox2.Items.Add(row[0].ToString()); } [/Code] You can also replace the first two lines of code with [Code] DataView dv = new DataView(this.dtTemp, "", "Items ASC", DataViewRowState.CurrentRows); [/Code]
  5. You need to use the DataView and DataRowView to see it sorted. eg dtUniqueProps.DefaultView.Sort = "[props] asc"; DataView dv = new DataView(dtUniqueProps); DataRowView row; for (int i = 0; i < dv.Count; i++) { row = dv[i]; MessageBox.Show(row["props"].ToString()); } [/Code] You can also set the rowfilter, sort and version of data you want when setting up the DataView.
  6. Thanks bri189a & SonicBoomAu Now got it working.
  7. Hi all What I am trying to do is open up a word template, name the document, fill in the details, Save and close word. I am able to open the template, fill in the details and close word. I just can't find out how to re-name the document and then get it to save where I want it. Any Ideas Please. Thank you
  8. Don't know if you have looked at this but it may help http://support.microsoft.com/kb/301659/ The link is to a c# example, there is a link on it if you want VB
  9. Ivan74 Althought I have not got a way of opening outlook and filling in the to, from, attachments etc. I do have two other ways of sending email with attachments. The first is to use the smtp client and send it direct, but you then have to keep a record of emails sent for yourself. The other has been using Outlook, this sends the email and saves it in the sent items folder. What I have not been able to do is test it with Outlook Express, the one machine that is using Outlook Express here also has outlook installed, the program saved the email to Outlooks outbox and would not let Outlook Express see it. So not sure if it would just crash on a machine with only Outlook Express on it, there may be a setting that tells it which version to use that I have not found yet. Anyway if these are of any help then let me know and I will post the code.
  10. Thanks I Will Have a Look
  11. If I remember correctly you can do the following this.ListView1.Items[3].Selected = true;
  12. Thanks guys that works, such a simple solutions but I just couldn't see it last night. (need more sleep or caffeine :) )
  13. Hi All Hope you can help, I am trying to open word and pass the document to open as a string. If the string is c:\bin\calllog.doc then it opens fine but if the path includes spaces then word says it can't find the document ie c:\Documents and Setting\Administrator\My Documents\CallLog.doc Can some one please tell me what it is I am forgetting to do :confused: this is the code I am using Process MyProcess; string ProgramToRun = "WINWORD.EXE"; string DocumentToOpen = dataaccess.rowActions[dataaccess.colACTAttachmentPath].ToString() + dataaccess.rowActions[dataaccess.colACTAttachment].ToString(); MessageBox.Show(DocumentToOpen); MyProcess = Process.Start(ProgramToRun, DocumentToOpen); MyProcess.WaitForInputIdle(); MyProcess.Close(); MyProcess.Dispose(); Thank you for your help
  14. Hi all Is it possible to write a program to retrieve emails and if so does anyone know where I can find an example? Thanks
  15. To change a text object you can do the following private void CrystalReportViewer1_Load(object sender, System.EventArgs e) { crReportDocument = new OpenItem(); TextObject textObject; textObject = crReportDocument.ReportDefinition.ReportObjects["txtRepDate"] as TextObject; // You now have the text objects properties available to change i.e. textObject.Font = ... CrystalReportViewer1.ReportSource = crReportDocument; } I believe for a data field it is FieldObject
  16. Thank you for your help Machaira I don't really like the dataview control so I think I will make my on way of doing this.
  17. Thank you Machaira for the program, I will down load it and have a look at home (I have SQL Server Developer addition there).
  18. Thank you for the Reply mskeel. Unfortunately they will not want it done as a web app due to the cost of setting up and the learning curve involved as I have not done any web apps yet. I will leave it as an Access database for the moment but I think I may start looking into getting some sort of SQL server, MySql / MSDE etc, as there is a large amount of data being kept and It might be quicker. Table 2 and 3 have similar data fields but one is for the day and one for the time interval. What I am looking to show is the schedule for a machine on a certain day i.e. Machine 6:00 6:15 6:30 .... I don't think there is a control that will do what I want so will make my own display. If you have any other ideas I will be grateful to hear them as this is giving me a headache :) Thanks
  19. Hi All I have been asked at work to write a production scheduling system and was wondering if anyone can give me some pointers on how to go about it. We have 12 machines that need to be included in the system, each machine needs a day record and each day is to be broken up into 15 minute segments. The system also has to hold 2 years data at a time, this year and next Year, with all preceding years being archived for analysis purposes. What I have come up with so far (after some playing) is a database with 3 tables. Table 1 will just hold the machine names and description. Table 2 Holds the day information i.e. is this machine available today, how many hours have been scheduled and how much of the work has been completed. Table 3 Holds the day�s hourly information broken up into 15 minute intervals, again with the same info as the day table. As you can imagine there are a lot of records and at the moment, all stored in an Access database. What I am wondering is: 1) Is this the best to hold the data? Or would a different data structure be better? 2) What is the best way to display the data? - Should I create my own control / display logic or is there a control that I can use. (I have tried displaying it in a listview and changing the background colour of the cells depending on the status of the time frame, but this seems to be quite slow and has a few display problems.) Any pointers will be gratefully received Thank You.
  20. yeh still going You can put the foumla where ever you need it printed. As for nulls I beleave you can use the following if IsNull (Your field) then ... else ... [/Code]
  21. Hi EFileTahi-A Long time know speak to, hows it going What I do is set up a formula. if {your field} = 0 then "Yes" else "No" then just print the formula
  22. Define a variable as type DialogResult then yourvariable = Messagebox.Show(......) if (yourvariable = DialogResult.OK)
  23. Right Click on Blank part of Report, in menu choose Designer and then Printer Setup.
  24. Hopefully Microsoft will do the same as they did with VS2003 and offer an update for $19 (I think that was what it was)
×
×
  • Create New...