|
First of all, please enclose your code samples in pre tags. This will make your questions much easier to read.
I think this is your problem...
Member 8479418 wrote: Dim intFundsRaised() As Integer = {175.5, 534.0, 1023.0, 655.5, 178.0, 633.0, 135.0,
178.5, 500.0, 122.0, 190.25, 16.0, 721.0, 463.0, 15.0, 189.0, 78.0, 0.0,
602.0, 10.0}
Try changing the Integer type to Double
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
Thanks Andy,
I tried doubles but it did not work, the results reading 0
|
|
|
|
|
Try setting a breakpoint in the code at the place I suggested. Press F5 and the program will stop at the breakpoint.
You will then be able to inspect the values of your variables and track down where the issue is.
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
Hi,
I am trying to fill the gridview with the data from an Access table for a range of dates.
Dim cmd1 As String = "Select * from " & inpTable & " Where mdateTime = '29/09/2011'"
MsgBox("cmd= " & cmd1)
Dim da As OleDbDataAdapter
Try
da = New OleDbDataAdapter(cmd1, myConnection)
Catch ex As Exception ' Catch the error.
MsgBox(ex.ToString) ' Show friendly error message.
End Try
Try
Dim table As New DataTable
da.Fill(table)
DataGridView1.DataSource = table
Catch ex As Exception
MsgBox(ex.ToString)
End Try
myConnection.Close()
Command as it appears in the MsgBox
Select * from rawClimateData Where mdateTime > 30/09/2011 10:45:00 AM
The query works if I am not filtering the data base; however, with filter I get the syntax error "missing operator".
Any suggestion??
|
|
|
|
|
dates are in "sqldateformat"
#mm-dd-yyyy#
Jan
|
|
|
|
|
Rewrite this as a parameterized query and you won't have to worry about what "format" the datetime objects are in.
Just Google for ".NET Sql parameterized query" and you'll find tons of exampels.
|
|
|
|
|
use this will work
Dim cmd1 As String = "Select * from " & inpTable & " Where convert(datetime,mdateTime,101) = convert(datetime,'09/29/2011',101)"
|
|
|
|
|
Hi, I'm trying to ask a "Exit Form?" question when the user clicked red close button at the top right of the form.
If the user clicked No, then the form won't close.
The problem is, i don't know where to put my coding.
I've tried to put it on Form event "FormClosing" but both Yes and No question close the form.
This is the code I use.
Private Sub MainForm_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
If MessageBox.Show("Exit Program ?", "Message", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) = Windows.Forms.DialogResult.Cancel Then
Return
End If
Application.Exit()
End Sub
Thank's before..
|
|
|
|
|
FormClosing is the correct event for this. Its second parameter has a Cancel property, if you set that true, the closing action will not go on (and FormClosed will not fire).
BTW: there is no need to call Application.Exit() in a FormClosing or FormClosed event handler (and it sure won't help you in keeping the form open!)
Suggestion: when interested in an event, always look at the second parameter; just use Intellisense (or MSDN documentation) to have an idea about the available information; what one needs typically is available right there.
|
|
|
|
|
to abort the close enter the following
e.cancel = true
|
|
|
|
|
Hi,
I have created in vb.net 2010 this picture
How can I create a picture without crossing other lines. I now maybee i can find something with google. But for that i need some clear pointers and I'm not a genius in English ( in other languages needer )
I have an even more difficoult picture Here
|
|
|
|
|
I suggest you start by reading WGE[^].
|
|
|
|
|
..can you pls help me to have a code in using a tree view,, thankz..
|
|
|
|
|
Have a read of this Treeview Example[^]
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
Hi,
I am using vb.net 2008. & 2003 ms access database.
how i connect my vb.net application to remote ms access database.
Thanks & Regards
Form :-
Vikash Yadav
Mob : 773785977
|
|
|
|
|
|
Public con As New OleDbConnection("Provider=MS Remote; Remote Server=http://shpl.co.in;Remote Provider=Microsoft.Jet.OLEDB.4.0; Data Source=d:\DBSMSoft.mdb;" & "Jet OLEDB:Database Password=3010329431;")
not working
Thanks & Regards
Form :-
Vikash Yadav
Mob : 9210907172
|
|
|
|
|
|
Hello ,
I'm having this problem to where I cannot copy a root directory (e.g.,J:\, F:\, V:\, E:\ <--Common removable drive roots) of a flash drive onto a specific area of the main hard drive on my computer.
It's basically copying the drive "J:\" to "C:\Flash Backup\Current date and time" on my computer, but I'm facing a problem, while compiling and debugging it gives me the error: Could not complete operation since directory is a root directory: 'C:\'.... is there anyway around this? I'm using the following line of code to copy it: Microsoft.VisualBasic.FileIO.FileSystem.CopyDirectory(directory to copy from, where to copy, some other stuff that are boolean values)
Any help would be greatly appreciated...
Regards,
Brandon T. H.
Codeproject Member
|
|
|
|
|
Hi.
I think your problem comes with WNet security implementation exploited by your Runtime (viewing code, I denote .NET but don't know what release). Perhaps making a 'net use ...' first, could solve the IOException. If not, here you can find information : http://msdn.microsoft.com/en-us/library/Aa385413[^]
Hope it helps!
Regards
|
|
|
|
|
Hello everyone -- Need some help. I am setting up an Access Database with employee information, here's the problem...I need to search for an EmployeeID and if it does not exist I need to add it, if it does exist I need certain fields on the form to autofill. It keeps crashing on the FindFirst statement...Here is my code
Private Sub ID_AfterUpdate()
Dim strAdd As String
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("Employee Table";)
rst.FindFirst "[ID] = " & Me.ID.Value
If rst.NoMatch Then
'Add new employee information to database
rst.AddNew
rst![ID] = Me.ID.Value
rst![SocSecNo] = Me.txtSocSecNo.Value
rst![Craft] = Me.txtCraft.Value
rst![JobNo] = Me.txtJobNo.Value
rst![LastName] = Me.txtLastName.Value
rst![Suffix] = Me.txtSuffix.Value
rst![FirstName] = Me.txtFirstName.Value
rst![MiddleInitial] = Me.txtMiddleInitial.Value
rst![TWICCardNo] = Me.txtTWICCardNo.Value
rst![TWICCardExp] = Me.dteTWICCardExp.Value
rst![HireDate] = Me.HireDate.Value
rst![TermDate] = Me.TermDate.Value
rst.Update
Else
'Autofill form based on ID number entered
Me.txtSocSecNo.Value = rst![SocSecNo]
Me.txtCraft.Value = rst![Craft]
Me.txtJobNo.Value = rst![JobNo]
Me.txtLastName.Value = rst![LastName]
Me.txtSuffix.Value = rst![Suffix]
Me.txtFirstName.Value = rst![FirstName]
Me.txtMiddleInitial.Value = rst![MiddleInitial]
Me.txtTWICCardNo.Value = rst![TWICCardNo]
Me.dteTWICCardExp.Value = rst![TWICCardExp]
End If
End Sub
Any help I can get will be very much appreciated...Thanks!
Cynthia Quiroz
|
|
|
|
|
Cynthia Quiroz wrote: It keeps crashing on the FindFirst statement...
Does it crash without any hints at what might be wrong? Doesn't VB6/ADO throw an error with a message?
Cynthia Quiroz wrote:
rst.FindFirst "[ID] = " & Me.ID.Value
Two things that could go wrong, theoretically; the column ID might not exist, or Me.ID could be vbNothing (or something similar).
Did you know that you can use .NET to do this kind of stuff? You could be writing VB.NET code and call that from VB6 - that way you don't have to rewrite the code later on
Bastard Programmer from Hell
|
|
|
|
|
I created a reference to a file at some location in the hard drive in a vb.net application.
db_optb.Image = Image.FromFile("F:\Documents and Settings\Raza\My Documents\My Pictures\quiz_pics\opt_bg_post.jpg")
The program executed fine.
But when i took the whole project folder to another PC and executed it there it gave a 'File does not exist' exception.
Definitely the file was not there in this PC.
So can place the file in the project and refer it in such a way that taking the project to any other place does not create problems?
|
|
|
|
|
Razanust wrote: I created a reference to a file at some location
That's not a reference, that's loading something from a specific path.
Razanust wrote: So can place the file in the project and refer it in such a way that taking the project to any other place does not create problems?
Include it as a resource[^].
Bastard Programmer from Hell
|
|
|
|
|
+5, Thats how I'd approach it too
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|