Zum Inhalt springen

ronaldus

Mitglieder
  • Gesamte Inhalte

    38
  • Benutzer seit

  • Letzter Besuch

  1. Hallo Tician, private Microsoft.Office.Interop.Excel.Application myExcelApplication = null; private Microsoft.Office.Interop.Excel.Workbook myExcelWorkbook = null; private void Release() { myExcelApplication.Quit(); releaseObject(myExcelWorkbook); releaseObject(myExcelApplication); } private void releaseObject(object obj) { try { System.Runtime.InteropServices.Marshal.ReleaseComObject(obj); obj = null; } catch (Exception ex) { obj = null; MessageBox.Show("Exception Occured while releasing object " + ex.ToString()); } finally { GC.Collect(); } } Gruß Ronald
  2. Hi, ESRI müsste so etwas anbieten. Muss man glaube ich bezahlen.... Gruß Ronaldus
  3. @lbm1305 Hast recht, wird von Sybase nicht unterstützt....Man könnte dort anscheinend eine File über BCP schnell in die DB laden... Gruß Ronaldus
  4. Hi, Beim Kopieren oder Einfügen großer Datenmangen nutze ich gern BulkInsert....Den Code der SQL-Klasse solltest du zur Analyse hier zugänglich machen, sonst kann man nicht viel erkennen... Gruß Ronaldus
  5. Hi, gehe über xml...dann kannst du Formatierungen mitgeben.. siehe C# - Excel-Export ohne Excel (auch für Web) Gruß Ronaldus
  6. Hi, vielleicht hilft das Beispiel von der msdn How to: Add Security Credentials to a SOAP Message Gruß ron
  7. Hi, Du musst definieren, was im DGV angezeigt werden soll... this.dgv.AutoGenerateColumns = false; private bool datagridViewKonfiguriert = false; /// <summary> /// Erstellt Grid-Ueberschriften und definiert Anzeigewerte /// </summary> private void BuildGridHeaderForGrid() { if (datagridViewKonfiguriert) { // Die Konfiguration wurde bereits einmal durchlaufen. // -> Keine weitere Aktion return; } DataGridViewTextBoxColumn idColumn = new DataGridViewTextBoxColumn(); idColumn.HeaderText = "ID"; idColumn.DataPropertyName = "Id"; idColumn.ReadOnly = true; this.dgv.Columns.Add(idColumn); DataGridViewTextBoxColumn nameColumn = new DataGridViewTextBoxColumn(); nameColumn .HeaderText = "Name des Users"; nameColumn .DataPropertyName = "Name"; this.dgv.Columns.Add(nameColumn ); ....weitere Spalten.... // Merken, dass die Liste konfiguriert wurde this.datagridViewKonfiguriert = true; } BuildGridHeaderForGrid() z.B. beim Initialisieren der Form aufrufen.... Wichtig: DataPropertyName = muss als Property definiert sein... So kannst Du nur bestimmte Werte des gebundenen Objektes im DGV anzeigen. Gruß Ron
  8. Hi, vielleicht helfen Dir folgende Links: Word Control for .NET - CodeProject und Integrate Word in .NET/ application (VB.NET/C#) Gruß Ron
  9. Hi, habe etwas in der msdn gefunden... Es scheint so, als ob man gar keine neue Word Application starten muss... Private document1 As Word.Document = Nothing Private Sub ThisAddIn_Startup() Handles Me.Startup SetzeFont() End If Private Sub SetzeFont() document1 = Me.Application.Documents.Add() document1.Selection.Font.Name = "Arial" End Sub Hier der Link: Extending Word Documents and Excel Workbooks in Application-Level Add-ins at Run Time Jetzt muss es doch hoffentlich mal klappen... Gruß Ron
  10. Hi, das ist doch wirklich kniffelig.... Versuch mal... bool init = false; Private Sub ThisAddIn_Startup() Handles Me.Startup if(!init) { //OBJECTS OF FALSE AND TRUE Object oTrue = true; Object oFalse = false; //CREATING OBJECTS OF WORD AND DOCUMENT Microsoft.Office.Interop.Word.Application oWord = new Microsoft.Office.Interop.Word.Application(); Microsoft.Office.Interop.Word.Document oWordDoc = new Microsoft.Office.Interop.Word.Document(); //MAKING THE APPLICATION VISIBLE oWord.Visible = true; //ADDING A NEW DOCUMENT TO THE APPLICATION oWordDoc = oWord.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing); oWord.Selection.Font.Name = "Arial"; init = true; } End Sub Gruß Ron
  11. Hi, mit dem Methoden-Zusatz Private Sub ThisAddIn_Startup() Handles Application.DocumentOpen registrierst Du ein Event, das abgefeuert wird, wenn das Dokument hinzugefügt wird. In dem Code entsteht scheinbar eine Endlos-Schleife, weil der Event bei jedem Aufruf der Methode erneut abgefeuert wird...bevor es in die Dokument-Liste hinzugefügt wird... Du solltest einen anderen Event registrieren... Private Sub ThisAddIn_Startup() Handles Me.Startup damit sollte der Event nur einmal abgefeuert werden... Ich kann das leider nicht ausprobieren...aber es sollte klappen. PS: Oder das Handles... einfach weglassen, man braucht doch eigentlich gar kein Event, oder? Gruß Ron
  12. Hi, es scheint, als ob das StartUp-Event bei Neuanlage eines Dokumentes immer wieder abgefeuert wird, Deine Prozedur Private Sub ThisAddIn_Startup() Handles Application.DocumentOpen immer wieder aufgerufen wird... ....Startup Event The Startup event is raised for each of the host items (document, workbook or worksheet) after the document is running and all the initialization code in the assembly has been run. It is the last thing to run in the constructor of the class that your code is .... Vielleicht kann man einen Trick anwenden.. .... if (oWord.Documents.Count == 0) { //ADDING A NEW DOCUMENT TO THE APPLICATION oWordDoc = oWord.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing); oWord.Selection.Font.Name = "Arial"; } Gruß Ron
  13. Hi, hier zwei Beispiele für ein Update der DB über ein Dataset: ADO.NET: Update a Database from a DataSet oder DATASET - update,insert record into database thro datset - C#.net Du scheinst das Update vergessen zu haben. Gruß Ron
  14. Hi, hast Du ein Verweis in Deinem Projekt auf Microsoft.Office.Interop.Word? Folgender Code funktioniert bei mir: //OBJECT OF MISSING "NULL VALUE" Object oMissing = System.Reflection.Missing.Value; //OBJECTS OF FALSE AND TRUE Object oTrue = true; Object oFalse = false; //CREATING OBJECTS OF WORD AND DOCUMENT Microsoft.Office.Interop.Word.Application oWord = new Microsoft.Office.Interop.Word.Application(); Microsoft.Office.Interop.Word.Document oWordDoc = new Microsoft.Office.Interop.Word.Document(); //MAKING THE APPLICATION VISIBLE oWord.Visible = true; //ADDING A NEW DOCUMENT TO THE APPLICATION oWordDoc = oWord.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing); oWord.Selection.Font.Name = "Arial"; PS: Du entwickelst in VB, der Beispielcode ist C#, müsstest Du natürlich umstellen... Gruß Ron
  15. Hi, Du musst ein Word Document erzeugen und es der Anwendung übergeben... //OBJECT OF MISSING "NULL VALUE" Object oMissing = System.Reflection.Missing.Value(); //OBJECTS OF FALSE AND TRUE Object oTrue = true; Object oFalse = false; //CREATING OBJECTS OF WORD AND DOCUMENT Word.Application oWord = new Word.Application(); [B]Word.Document oWordDoc = new Word.Document();[/B] //MAKING THE APPLICATION VISIBLE oWord.Visible = true; //ADDING A NEW DOCUMENT TO THE APPLICATION [B]oWordDoc = oWord.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);[/B] ...und dann solltest Du die Schriftart ändern können... oWord.Selection.Font.Name = "Schriftart" Gruß Ron

Fachinformatiker.de, 2024 by SE Internet Services

fidelogo_small.png

Schicke uns eine Nachricht!

Fachinformatiker.de ist die größte IT-Community
rund um Ausbildung, Job, Weiterbildung für IT-Fachkräfte.

Fachinformatiker.de App

Download on the App Store
Get it on Google Play

Kontakt

Hier werben?
Oder sende eine E-Mail an

Social media u. feeds

Jobboard für Fachinformatiker und IT-Fachkräfte

×
×
  • Neu erstellen...