|
Search google for "file formats for programmers", and you'll find excellent results on this topic
|
|
|
|
|
Ok, so basically i am trying to use a DataGrid, VB, and an Access database to keep track of some information. But I cant remember or i guess figure out how to make the information i want to go from a label, to display in a cell in the datagrid, and also some where in there update the database. Im figuring that the easiest and best way to do that would be to Update the database then redisplay it in the datagrid, but i just cant get the right code for it. Any help, MUCH Appreciated.
|
|
|
|
|
DataGrid's have been upgraded in VS 2005 to DataGridViews. This new object has a ton of new stuff. Here are a few links to help you with them.
Overview[^]
List of How tos[^]
How this helps.
|
|
|
|
|
I am writing a function to check for invalid characters in a file befor written to db but when I run the project I get the following error: Conversion from string "06110-001-000" to type 'Boolean' is not valid.
Here is the code I have.
Function:
Public Function InvalidCharacterCheck(ByVal StringToCheck As String)
Dim InvalidChars As String() = {",", ".", "'"}
Dim B As String
For Each B In InvalidChars
If InStr(StringToCheck, B) Then
Return True
End If
Next B
Return False
End Function
Code to handle function:
If InvalidCharacterCheck(row("PartNumber") = True Or InvalidCharacterCheck(row("mostforwardpartnumber"))) = True Then
ErrorLog("Not Valid partnumber or Supercede partnumber: " & row("PartNumber"))
Else
Any suggestions?
jds1207
|
|
|
|
|
jds1207 wrote: If InvalidCharacterCheck(row("PartNumber") = True Or InvalidCharacterCheck(row("mostforwardpartnumber"))) = True Then
i think it needs to be like this
If InvalidCharacterCheck(row("PartNumber")) = True OrElse InvalidCharacterCheck(row("mostforwardpartnumber")) = True Then
|
|
|
|
|
Does anyone have a Screensaver app in vb.net 2.0 that I could use as a starter? I am looking for one that will just cycle through jpg's in a shared folder. I don't mind buying one for a few bucks but it would be nice to be able to have the code to customize it myself.
|
|
|
|
|
I think Visual Basic express edition comes with a starter pack that includes a screen saver.
|
|
|
|
|
Hello,
I am trying to make a scheduling application so I have a UI with checkboxes for every weekday and save the values in the DB. When the user wishes to make a new schedule, I don't want to allow conflicts,i.e 2 schedules running on a weekday at the same time. So if the previous schedule is for Monday, Tue, and Wed and the current is for some other days(maybe includes Wed, Mon, and Tue maybe doesn't). Problem is how do I check this, how can I verify that the schedule is not conflicting. I am first comparing the times before the days as if the time is not the same there will be no conflict.
Remember I only have to check the checked days against the stored checkdays in DB, or Do I?
Thanks b4 hand
Yoshimitsu
|
|
|
|
|
When your user logins to the application, you should probably pull their schedule from the database and put it into a DataTable. This will enable you to quickly evaluate their selections against their pre-existing database content without having to make round-trips back and forth to the database.
Secondly, when the application begins running, you might want to enumerate all of your checkboxes against the DataTable, to find out which ones should be selected and which ones should not be selected, according to the database information stored in the DataTable.
Next, when a CheckBox event Checked is raised, you can take the arguments and pass them to the dataTable to see if they conflict with any data on file. If not, then write to your datatable the new data.
Just be sure to update the DataSource from your DataTable with a DataAdapter once you're finished.
Jonathan Sampson
www.SampsonResume.com
|
|
|
|
|
Thanks a bunch. I just had to keep going because of time constraint and somehow managed to do it. I was actually saving the contents in an arraylist so I didn't have to make round trips.
Thanks once again.
Yoshimitsu
|
|
|
|
|
So, my foray into VBA continues. Under Excel, I am developing a financial application. This is my first time using VBA, so I am a little clueless on certain (simple) things. The problem I have is the following:
I have data stored in an array that I write to a column in Excel. The length of the array can vary from calculation to calculation. Thus, I write the data from the array to the A column on the spreadsheet. Let's say the length of the array is n. So I write n elements to column A on the Excel spreadsheet. Now, I am trying to get excel to automatically plot the data in column A on a graph, but n is variable. So in one instance n may be 100. In another n may be 233, for example. The problem is that I don't know how to automatically determine the length of the column so that I can plot the data on an Excel chart. Any assistance would be appreciated.
Thanks in advance.
|
|
|
|
|
Use the Chart object, as in the following sample:
Dim MyArray(4) As Long
MyArray(0) = -5: MyArray(1) = 1: MyArray(2) = 2: MyArray(3) = 4: MyArray(4) = 7
With Worksheets(1)
Set a = .ChartObjects(1).Chart
.ChartObjects(1).Chart.SeriesCollection(1).Values = MyArray
End With
Hope that's useful
|
|
|
|
|
Chapter 6 "Using Excel's Range and Chart Objects" of Microsoft Office 2000 Visual Basic for Applicatio - fundamentals - might help. I will send the text of "Using Excel's Range and Chart Objects" to by e-mail via CP.
modified 1-Aug-19 21:02pm.
|
|
|
|
|
Richard A. Abbott wrote: Chapter 6 "Using Excel's Range and Chart Objects" of Microsoft Office 2000 Visual Basic for Applicatio - fundamentals - might help. I will send the text of "Using Excel's Range and Chart Objects" to by e-mail via CP.
Ah, that would be great, thanks. I don't have any reference books handy! (As you can probably tell...)
|
|
|
|
|
When my application runs on a certain HP computer the last letter on each label on the form is cut off making the labels illegable. On all other computers we installed the application on the labels look fine. Why doesn't the HP computer display the labels correctly?
|
|
|
|
|
I think its a problem with the resolution on that computer
|
|
|
|
|
Your label boxes are being cut off because your form's layout doesn't allow for different DPI settings or resolutions. I'd direct you to the documentation and some articles on MSDN on the subject, but the MSDN site isn't responding right now.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks.
I changed the AutoResizeMode = dpi
This fixed everthing except for some of the label controls. The code defines the location of some of the labels on the form at runtime. The code bases the locations on a 96dpi but if the app runs on a computer with a different dpi the labels are put in the wrong spot. I think I need to know the computer's dpi when calculating the locations of these labels. How can I get that?
|
|
|
|
|
If think your talking about AutoSizeMode , not ...ResizeMode. If the AutoSizeMode is set to DPI, then you can checks the Forms CurrentAutoScaleDimensions property. It'll return a SizeF object with the current DPI of the screen.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi there,
I am working on an application which checks the remote computer running WinXP/2k that wheather it is locked or not. I have searched every where but not able to find the solution . there is one article on this issue but it only determines the state of the local computer means application have to be installed on local computer. whereas in my case the application will run from central computer w:(hich shall check the status of remote computers on local LAN.
Please help me in this regard
Thanks
Muhammad Farhan Farooq
|
|
|
|
|
There is no way to determine the workstation status without code running on each workstation you want to check. Even then, there is no function you can call that will tell you if the workstation is locked or not. It must be deduced using other methods. You can read more about a possible solution here[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi All,
Can anyone tell me how to load the form in a maximized way.
|
|
|
|
|
Me.WindowState = FormWindowState.Maximized
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
|
running vb.net 2005 & sql 2005
Ive been trying to add what seemed a simple table to a form ... only three four fields plus an update and cancel button
I managed to ( from samples ) add an OleDbConnection connecton, a OleDbDataAdapter complete with select and update commands and a dataset . From previous samples ( win 2003 dataform ) i have the four text boxex reporting back the data from the dataset ... Stage 1 complete. now here is where i was comming a cropper, when trying to update the table i used the following commands
Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
Try
'Attempt to update the datasource.
Me.UpdateDataSet()
MsgBox(" Update sucessful")
Catch eUpdate As System.Exception
'Add your error handling code here.
'Display error message, if any.
System.Windows.Forms.MessageBox.Show(eUpdate.Message)
End Try
End Sub
Public Sub UpdateDataSet()
'Create a new dataset to hold the changes that have been made to the main dataset.
Dim objDataSetChanges As Boss.net.DebBacsFmDestAccs = New Boss.net.DebBacsFmDestAccs
'Stop any current edits.
Me.BindingContext(DebBacsFMDestAccounts1, "DebBacsFmDestAccs").EndCurrentEdit()
'Get the changes that have been made to the main dataset.
objDataSetChanges = CType(DebBacsFMDestAccounts1.GetChanges, Boss.net.DebBacsFmDestAccs)
'Check to see if any changes have been made.
If (Not (objDataSetChanges) Is Nothing) Then
Try
'There are changes that need to be made, so attempt to update the datasource by
'calling the update method and passing the dataset and any parameters.
Me.UpdateDataSource(objDataSetChanges)
DebBacsFMDestAccounts1.Merge(objDataSetChanges)
DebBacsFMDestAccounts1.AcceptChanges()
Catch eUpdate As System.Exception
'Add your error handling code here.
Throw eUpdate
End Try
'Add your code to check the returned dataset for any errors that may have been
'pushed into the row object's error.
End If
End Sub
Public Sub UpdateDataSource(ByVal ChangedRows As Boss.net.DebBacsFmDestAccs)
Try
'The data source only needs to be updated if there are changes pending.
If (Not (ChangedRows) Is Nothing) Then
'Open the connection.
Me.OleDbConnection1.Open()
'Attempt to update the data source.
OleDbDataAdapter1.Update(ChangedRows)
End If
Catch updateException As System.Exception
'Add your error handling code here.
Throw updateException
Finally
'Close the connection whether or not the exception was thrown.
Me.OleDbConnection1.Close()
End Try
End Sub
The eupdate throws the following error
"Child list for field DebBacsFmDestAccs cannot be created"
Im at a loss as to what to do now, please can anybody help
I really do need help..... all this computer stuff is way over my head !!
|
|
|
|