Jump to content
Xtreme .Net Talk

NekoManu

Avatar/Signature
  • Posts

    75
  • Joined

  • Last visited

About NekoManu

  • Birthday 03/23/1966

Personal Information

  • Visual Studio .NET Version
    Visual Studio 2005 Express Edition
  • .NET Preferred Language
    C#

NekoManu's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I'm filling a Combox with values from a database. After that I get the last value from another table and want to position the combobox to the correct value. The questions is how? For Each BadgeItem In frmMainForm.cboBadge.Items If BadgeItem.Badge = myDataRow.Item("Data") Then 'Set correct index, but how? End If Next
  2. I have never tried this before, so I have been looking for a workng example. So far no luck. I want to open an Excel 2007 file in VB.Net. When I try I get an error: Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD)) I have no idea what is going on. This is the code I'm using: Private Sub btnExcel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExcel.Click Dim xlApp As Excel.Application Dim xlWorkBook As Excel.Workbook Dim xlWorkSheet As Excel.Worksheet xlApp = New Excel.ApplicationClass xlWorkBook = xlApp.Workbooks.Open("C:\Test.xlsx") xlWorkSheet = xlWorkBook.Worksheets("sheet1") 'display the cells value B2 MsgBox(xlWorkSheet.Cells(2, 2).value) 'edit the cell with new value xlWorkSheet.Cells(2, 2) = "http://vb.net-informations.com" xlWorkBook.Close() xlApp.Quit() releaseObject(xlApp) releaseObject(xlWorkBook) releaseObject(xlWorkSheet) End Sub Private Sub releaseObject(ByVal obj As Object) Try System.Runtime.InteropServices.Marshal.ReleaseComObject(obj) obj = Nothing Catch ex As Exception obj = Nothing Finally GC.Collect() End Try End Sub
  3. I want to insert names into a database. Everything works fine until I want to insert a name with a quote. My insert command is: strSql = "Insert Into Individual (Name, FirstName) Values ('" & strINDIName & "', '" & strINDIFirstName & "')" This works fine when I want to insert a name like: Cain But it does NOT work with: O'Cain
  4. Thanks I seems to work. Here is how to get rid of anything that is not a letter: Regex.Replace(InString, @"[^a-zA-Z]", "")
  5. I have a string and I want to remove anything that is not a letter. I know I can use the replace method, but then I have to check for everything. I hope there is a better way of doing this.
  6. I have a Usercontrol with a virtual method. When I use this control I want to override this method. I don't know how to do this. Can anybody help Please? This is the Control: namespace soReport { public partial class ReportContainer : UserControl { private string _ProfileName = ""; private string _ReportName = ""; public ReportContainer(string ReportName) { InitializeComponent(); _ReportName = ReportName; } private void ReportContainer_Load(object sender, EventArgs e) { RegistryKey ReportKey = Registry.CurrentUser.OpenSubKey(soSystem.RegistryEntry + soSystem.ApplicationTitle + "\\Reports\\" + _ReportName + "\\" + _ProfileName, true); if (ReportKey == null) ReportKey = Registry.CurrentUser.CreateSubKey(soSystem.RegistryEntry + soSystem.ApplicationTitle + "\\Reports\\" + _ReportName + "\\" + _ProfileName); GetContainerOptions(ReportKey); ReportKey.Close(); } public virtual void GetContainerOptions(RegistryKey ReportKey) { } public string ProfileName { get { return _ProfileName; } set { _ProfileName = value; } } } } In the form where I use this control I want to override GetContainerOptions.
  7. I know BUT I want to write those settings to the registry automatically. If I use the closing event of the form, I need to call the method for writing the settings each time I use my control. Like in the Load of the control, I will have the settings each time I use the control. The same way I want to write the settings each time I use the control.
  8. I have a UserControl where in the Load Event I Read the settings from the registry. I also want to write those settings back to the registry. My question is which event do I use? What is the opposite of Load? Is there something like Unload?
  9. The thing is that it works when I open it (the project) in the solution in which the baser form is. If I open the project in a different solution it does not work. Very strange, but then again it is Microsoft
  10. I think it is working now. There must have been something wrong with the references. Thank you.
  11. I am using C#
  12. I did add the project to the references and added the project to my solution, but when I call the form, the code is not executed.
  13. That works if my form is in the same project as the rest. What I want to do is create a form in a separate project and then call it from another project.
  14. I have a project with myForm. This form is based on a form and uses the icon of the parent form. I also have a project soReport. In this Project I want to create a form based om myForm. In my application I do the following: myForm dlgMyForm = new myForm(); dlgMyForm.showDialog(); When I run the application I get a warning that there is no user code and such, and the code in myForm does NOT work. Can anyone explain to me what I'm doing wrong and how it should be done?
  15. I could do that, but than I have to write the same code in each textbox. Or am I wrong with that?
×
×
  • Create New...