|
I thought I checked that. It fixed the problem.
Thanks for the help.
I sense a series of adjustments going from VB6 to
VS 2008 is ahead.
|
|
|
|
|
The problem is that for VB6, the default was "ByRef", but for VB.NET, the default is "ByVal".
David Anton
Convert between VB, C#, C++, & Java
www.tangiblesoftwaresolutions.com
|
|
|
|
|
Hello all, i have been making a few Visual Basic Applications as a bit of a hobby. Is there anyway to make an application read some files that contain code and have a program act accordingly. in other words have a add-on/plug-in system for a program.
Any help is appreciated! thanks!
|
|
|
|
|
There is a namespace in .Net called CodeDom , which can be used to compile and run code on-the-fly so to speak. If you google vb codedom you should get plenty of hits with a good tutorial.
Good Luck
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
|
|
Please help on this code. I tried to update record in datetime field in access but yields concurrency exception. Tnxs.
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
'saves edited record.
If MessageBox.Show("Sure to save record?", "Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) = Windows.Forms.DialogResult.Yes Then
Dim qryTask As String = "SELECT * from tblTask where fix(task_id) = '" & id & "'"
daTask.SelectCommand = New OleDbCommand(qryTask, connection)
Dim cb As OleDbCommandBuilder = New OleDbCommandBuilder(daTask)
daTask.Fill(dsTask, "tblTask")
dtTask = dsTask.Tables("tblTask")
bolSave = True 'user saved changes.
Dim intCatId% = -1
dtTask = dsTask.Tables("tblTask")
Dim strMonth As String = Format(Me.dtpDeadline.Value, "MM")
Dim strDate As String = Format(Me.dtpDeadline.Value, "dd")
Dim strYear As String = Format(Me.dtpDeadline.Value, "yyy")
Dim strCat$ = Trim(Me.cboCategory.Text)
intCatId = udfCategoryId(strCat)
If Me.txtTask.Text = "" Or Me.txtDetails.Text = "" Then
MessageBox.Show("Please fill up Task and Task Details!", "Save", MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
End If
'check date.
If Trim(strStartTime) = "" Then
If Trim(Me.txtStartTime.Text) = "" Then
strStartTime = ""
Else
strStartTime = Trim(Me.txtStartTime.Text)
End If
ElseIf Trim(strStartTime) <> "" Then
If Trim(Me.txtStartTime.Text) = "" Then
strStartTime = ""
Else
strStartTime = strStartTime
End If
End If
''check date.
If (strEndTime) = "" Then
If Trim(Me.txtEndTime.Text) = "" Then
strEndTime = ""
Else
strEndTime = Trim(Me.txtEndTime.Text)
End If
ElseIf Trim(strEndTime) <> "" Then
If Trim(Me.txtEndTime.Text) = "" Then
strEndTime = ""
End If
End If
Try
With dtTask
.Rows(0)("Task") = IIf(txtTask.Text = "", System.DBNull.Value, txtTask.Text)
.Rows(0)("Task_Details") = IIf(txtDetails.Text = "", System.DBNull.Value, txtDetails.Text)
.Rows(0)("Task_Status") = IIf(txtStatus.Text = "", System.DBNull.Value, txtStatus.Text)
.Rows(0)("Deadline") = Format(Me.dtpDeadline.Value, "MM/dd/yyy")
.Rows(0)("Year_Deadline") = Format(Me.dtpDeadline.Value, "yyy")
.Rows(0)("Task_Category_Id") = CInt(intCatId)
.Rows(0)("Start_Time") = IIf(strStartTime = "", System.DBNull.Value, FormatDateTime(strStartTime, DateFormat.LongTime))
.Rows(0)("End_Time") = IIf(strEndTime = "", System.DBNull.Value, FormatDateTime(strEndTime, DateFormat.LongTime))
End With
daTask.Update(dsTask, "tblTask")
MessageBox.Show("Record successfully saved!", "Save", MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch ex As OleDbException
MsgBox(ex.ToString)
End Try
Else
MessageBox.Show("Record not saved.", "Save", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End Sub
|
|
|
|
|
Hello;
Please don't bother to answer this query. I found out the culprits - the same variables declared globally.
Tnxs.
|
|
|
|
|
digibat wrote: I found out the culprits - the same variables declared globally
Kudos to you! In the future if you post code, please use the pre tags to make the code more readable in these forums
""Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
hi, i find a super trojan (server + client work perfectly) at Here
<mg src="http://www.007.somee.com/resim/paradise.jpg">
---you will see the source code at the program menu.
|
|
|
|
|
and??
modified 29-May-12 10:21am.
|
|
|
|
|
Spreading virus-code is an offence in the Netherlands. Keep that in mind on your next holiday, it may be one that lasts four years (or a fine of 25.000 Euro's)
Bastard Programmer from Hell
|
|
|
|
|
looking for usable code sending attachment with winsock in vb6, I don't know how to encode and send. anybody give me a post ? Thank you so much!
|
|
|
|
|
VB6?? You're not going to find it here. VB6 was declared dead years ago. Not surprising considering VB.NET replaced it over 10 years ago.
|
|
|
|
|
I have a program .net, and a mysql database. My problem is how to compile the database and my program into one. Please help me,,,,
|
|
|
|
|
You can't.
.EXE's, when running, cannot be written to, which would make your database read-only anyway.
On top of that, the MySQL engine doesn't support reading a database inside an executable.
Your database must be a seperate file.
|
|
|
|
|
Thansk Mr Dave Kreskowiak,,,,,
|
|
|
|
|
Hi All,
I have a database called cohort in sql server 2008 r2 express with a table called school with the following fields; schoolname,schoolcode,zone,district,division.I also have vb 2010 form with five comboboxes.Now my question is how can i link comboxbox1 to table field schoolname,combobox2 to schoolcode,combobox3 to zone,combobox4 to district,combobox5 to division. And how to apply filter in combobox.For example if i select a particular division in combobox the next combobox for zone should only display zones for that particular division etc. I have tried to add data source to my vb application but cannot access it. Is there any coding that can substitute data objects on the form. I have managed to write a connection string for the database.
|
|
|
|
|
i would love to change windows button to keep pressed when i press it and back to the normal state when pressed again.
does windows button support dat? 
|
|
|
|
|
You could use the FlatStyle options, Unpressed is Standard, Pressed I believe if represented as Flat.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Button1.FlatStyle = FlatStyle.Flat Then
Button1.FlatStyle = FlatStyle.Standard
Else
Button1.FlatStyle = FlatStyle.Flat
End If
End Sub
Hope this helps 
|
|
|
|
|
Take a CheckBox and change the Appearance property from Normal to Button and it will behave exactly as you want. Respond to the CheckChanged event to find out when the 'pressed' state changes.
Alan.
|
|
|
|
|
|
Hi!
I would like to know if the Copy to Output Directory property can also
be useable in source code when it comes to all file types?
So far, it has its use for components and web applets.
Can this be done in source code?
Thanks in advance for your responses.
JohnPDB
|
|
|
|
|
What options do you see when you view the properties for the source file?
|
|
|
|
|
What I'm trying to ask does the "Copy to Output Directory" property is included in the Intellisense and then a user tries to assign the property to one of the three values: copy always, copy if new, do not copy. A user would assign the property to the value, Do Not Copy.
Any questions or comments?
|
|
|
|