|
Reported as "abusive" for your responses to me and others in the copy of this post over in Q&A.
|
|
|
|
|
I am trying to populate a ComboBox thru my business and data layer and it's not working for some reason. The data is there but the combobox isn't being populated. I'm using a Class that controls all passing of data from my UI to my Business Layer to my Data Layer. In my Class, I have a ComboBox control along with other controls and Data Types.
Below is the code that pertains to this functionality.
Private Sub frmEquipmentSetup_Load(sender As Object, e As EventArgs) Handles MyBase.Load
LoadIntervalComboBox()
.
.
.
End Sub
Private Sub LoadIntervalComboBox()
Try
InitializeErrorClass(EH)
BL.LoadIntervalComboBox(EH)
If EH.ErrorMessage = "" Then
cmbCDInterval = EH.Combo
End If
EH.ErrorMessage = ""
Catch ex As Exception
EH.ErrorMessage = "LoadIntervalComboBox() - " & ex.Message & "~E"
End Try
EH.ProcessMessages(Me, sbr, EH.ErrorMessage)
End Sub
Public Sub InitializeErrorClass(ByRef EH As ErrorHandling.ErrorHandler)
Try
EH.DataSet = New DataSet
EH.DataTable = New DataTable
EH.ErrorMessage = ""
EH.Character = ""
EH.Bool = False
EH.Number = 0
EH.Combo = New ComboBox
EH.Exception = Nothing
Catch ex As Exception
EH.ErrorMessage = "cmbInitializeErrorClass() - " & ex.Message & "~E"
End Try
End Sub
Public Function LoadIntervalComboBox(ByRef EH As ErrorHandling.ErrorHandler)
Try
Dim strFields As String = "interval_ID,interval"
Dim strTblID As String = "LKUP_CalInterval"
Dim strCriteria As String = "active <> 0"
Dim strOrderBy As String = ""
DL.GetData(strTblID, strFields, strCriteria, strOrderBy, EH)
If EH.DataSet.Tables(0).Rows.Count > 0 Then
EH.Combo.DataSource = Nothing
EH.Combo.DataSource = EH.DataSet.Tables(0)
EH.Combo.DisplayMember = "interval"
EH.Combo.ValueMember = "interval_ID"
EH.Combo.SelectedIndex = -1
End If
Catch ex As Exception
EH.ErrorMessage = "LoadIntervalComboBox() - " & ex.Message & "~E"
End Try
Return EH
End Function
Imports System.Windows.Forms
Public Class ErrorHandler
Public gTimeOut As Integer = 0
Public gSplashTimer As Integer = 0
Public gMessageTimer As Integer = 0
Public gblnHalt As Boolean = False
Public gblnEscape As Boolean = False
Public gblnPause As Boolean = False
Public gblnMessageTimer As Boolean = False
Public gblnFlashMessage As Boolean = False
Public gblnHideMenuIcons As Boolean = False
Public WithEvents tmrMessage As New Timer
Public gSBR As New StatusStrip
Public Property ErrorMessage As String
Public Property Number As Integer
Public Property Character As String
Public Property DataTable As DataTable
Public Property DataSet As DataSet
Public Property Exception As Exception
Public Property Bool As Boolean
Public Property Miscellaneous As String
Public Combo As ComboBox
.
.
.
Blake McKenna
modified 18-Feb-14 18:23pm.
|
|
|
|
|
Where is the form created? And where is the ErrorHandler class instantiated?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Dear All,
I have a spreadsheet with a list of names and e-mail addresses. I have created a code that when clicked will open my default mail program. I can then click send. Start of the code is below (the full code works but I must manually click each time)
Quote: ="mailto:"&E2&"?subject="&B2&
I would like to know if it's possible to create a VBA code or similar within NeoOffice that will automatically load up these 30 hyperlinks so I don't have to click 30 times.
Please help!
|
|
|
|
|
If the cells containing the links are in sequence then you can just code a simple loop which repeats the same code through all the relevant cells.
|
|
|
|
|
Hey Richard! It's great to hear from you! Thank you for the reply.
I probably should have added - I'm a complete beginner to Visual Basic and have never tried coding anything. Is there a tutorial for how to start coding / implement the code you suggested?
Yes all the links are in order. Any help would be amazing.
|
|
|
|
|
Member 10603840 wrote: I'm a complete beginner to Visual Basic But your question is about using VBA which is a slightly different beast. If you want to learn it then you can use the help system in Microsoft Office, or use Google to find tutorials. I know nothing abot NeoOffice, so I cannot comment further.
|
|
|
|
|
How to declare a global variable and access it's value anywhere..
|
|
|
|
|
|
A couple of ways
1. use a module not my favourite suggestion
public module GlobalVariables
public foo as string
end module
2. shared class with shared variables
public shared class FooBar
public shared SomeValue as integer =1
end class
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
I have one using excel 2000 vba.now we upgrade use window 8 64 bit and excel 2010 so
when I add control listview, it show message "Library not registered"
anybody has idea?
Best regards
|
|
|
|
|
Samoeurn wrote: I have one using excel 2000 One what?
Samoeurn wrote: when I add control listview, it show message "Library not registered" What library, where does the message appear, what line of code ... ?
Please be clear and specific with the details of your problem. Remember, we cannot see your screen.
Veni, vidi, abiit domum
|
|
|
|
|
I have One VBAProject that is excel add in. If I use window 8 x86, it works perfectly but now our company upgrade using window x64.it has one problem,one control is not support "Listview" and shows error message below:
1.Library not registered
2.Compile error in hidden module: frmChart
this error commonly occurs when code is incompatible with the version,platform, or architecure
of this application. Click "help" for information on how to correct this error.
please kindly help appreciate
Thanks
|
|
|
|
|
Samoeurn wrote: code is incompatible with the version,platform, or architecure Rebuild your addin on the new platform.
Veni, vidi, abiit domum
|
|
|
|
|
Samoeurn wrote: anybody has idea?
You've referenced a COM-library in your sheet that's 32-bit. It does not get loaded in the 64-bit version of Excel. Then it crashes.
Solution; get a 64 bit version of the library, or switch back to 32-bit Office.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Top of each form, modules and classes that have references. Fill in the blanks.
#If Win64 Then
put your 64 bit library references here
#ElseIf Win32 Then
put your 32 bit library references here
#Else
Msgbox "You are either trying to run this from a computer " _
"you found at a yard sale or you bought an Apple"
#End If
|
|
|
|
|
Send a Text Message to a Cell Phone from a VB.NET Application
|
|
|
|
|
Why not make an effort to do your own search for examples of code for this. Paste your question into Google for a start.
Veni, vidi, abiit domum
|
|
|
|
|
|
I hope its not for spamming and spoofing! I am getting tired of Sarah from Consumer Services calling me on a spoofed voip line. I would be more upset if they were wasting my message limit
|
|
|
|
|
Is it possible to create a MySql view using vb2008 If yes can anybody provide with some tips on how to do that.
Thanking in advance.
|
|
|
|
|
SPSandy wrote: Is it possible to create a MySql view using vb2008 Yes.
SPSandy wrote: If yes can anybody provide with some tips on how to do that. Using the ExecuteNonQuery method of the IDbCommand class; you'd execute a SQL-query (Google for examples) containing a "CREATE VIEW" statement (again, Google has the syntax).
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
My apologies for the above answer; it may be correct, but it is hardly helpfull. Let me see if I can improve on the answer above. There's an abstract example of what you want to achieve below; (abstract as in it contains a bit pseudocode, not as "an abstract class")
Public Sub CreateView()
Using con As New MySqlConnection("your connection string here")
Using cmd As MySqlCommand = con.CreateCommand()
con.Open()
cmd.CommandText = _
" CREATE VIEW view_name AS " +
" SELECT column_name(s) " +
" FROM table_name " +
" WHERE condition "
cmd.ExecuteNonQuery()
con.Close()
End Using
End Using
End Sub
There are a few resources you might need;
I'd also recommend downloading at least VS2010; it comes with .NET 4, which performs a bit better than the 2.0 runtime. Also gives you some nice extra's, like mini-dumps in .NET - very powerfull when debugging with one o' those. There were also some nice language-enhancements in the IDE. An upgrade would well be worth the effort.
Since you'd be going to create views, I'd also like to point out that there are various options for naming those views. It'd be redundant to add the word "view" to it, but looking at other databases, it also looks like a tradition. MySQL does not allow some characters in the view-name. The W3Schools shows such an example with spaces.
Please don't do that. Just do it without spaces. It's not just MySQL that could blow up; furtherdown the line, there's probably an ORM or something generated from that view (like a report) and than that will blow up. Then the problem probably gets posted here, and I blow up.
Going offtrack a little further; for those wondering why I have a macro autofill the quotes to a single level - it makes it easy to cut & past the query into SQL Managment Studio (using block-select, ALT-SHIFT while you select text) and to paste it back into VS.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks a lot. This was really very useful.
|
|
|
|
|
I am just wondering if it's posible to make that?
I have my MyApplication.exe inside my form and I want it to be just fix on its location?
System.Diagnostics.Process.Start("MyApplication")
Dim P As System.Diagnostics.Process = System.Diagnostics.Process.GetProcessesByName("MyApplication")(0)
P.WaitForInputIdle()
SetParent(P.MainWindowHandle, Me.Panel1.Handle)
We can resize the panel by adding
MoveWindow(P.MainWindowHandle, 0, 0, 500, 300, True)
but its posible to make it fix on that location?
modified 11-Feb-14 10:52am.
|
|
|
|