|
to anyone who has encounter appforge.. pls help..
im encountering problem with the PDBOpen method..this is my code..
Public Function OpenPatientInfoDatabase() As Boolean
lType = PalmIDtoLong("DATA")
lCreator = PalmIDtoLong("!!)<")
' Open the database
#If APPFORGE Then
'when running on the device
dbPatientInfo = PDBOpen(Byfilename, "PatientInfo", 0, 0, 0, 0, afModeReadWrite)
#Else
'when running on windows
dbPatientInfo = PDBOpen(Byfilename, App.Path & "\PatientInfo", 0, 0, 0, 0, afModeReadWrite)
#End If
If dbPatientInfo <> 0 Then
'We successfully opened the database
OpenPatientInfoDatabase = True
Else
'We failed to open the database
OpenPatientInfoDatabase = False
#If APPFORGE Then
MsgBox "Could not open database - PatientInfo", vbExclamation
#Else
MsgBox "Could not open database - " + App.Path + "\PatientInfo.pdb" + vbCrLf + vbCrLf + "Potential causes are:" + vbCrLf + "1. Database file does not exist" + vbCrLf + "2. The database path in the PDBOpen call is incorrect", vbExclamation
#End If
End If
End Function
..at the line dbPatientInfo = PDBOpen(Byfilename, App.Path & "\PatientInfo", 0, 0, 0, 0, afModeReadWrite)
there is an error: byfilename is a variable undefined..
how could this be?i know byfilename is a keyword to pdopen..
help..
|
|
|
|
|
jbboy wrote: ..at the line dbPatientInfo = PDBOpen(Byfilename, App.Path & "\PatientInfo", 0, 0, 0, 0, afModeReadWrite)
there is an error: byfilename is a variable undefined..
how could this be?i know byfilename is a keyword to pdopen..
Keywords are specific to the language you're writing in, not the library. I think you're talking about the value of a contant or enum in the library. To VB, you tried to pass in the contents of a variable that you haven't even declared anywhere. That value should be declared in the library somewhere. I suggest going back to the documentation on the library and looking up this method or searching for a sample.
I know nohting of the library that you're using, so this is just a guess, but it looks like it should read like this:
dbPatientInfo = PDBOpen("Byfilename", App.Path & "\PatientInfo", 0, 0, 0, 0, afModeReadWrite)
or some other value, possibly like:
dbPatientInfo = PDBOpen(YourLibraryName.Byfilename, App.Path & "\PatientInfo", 0, 0, 0, 0, afModeReadWrite)
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
thanks for the reply..
actually pdbopen is under the appforge library.. appforge is an addin to vb where you can develop mobile apps..
Byfilename is like an option of PDOpen like the afModeReadWrite..
thanks again..
|
|
|
|
|
i m using vb.net2005 windows application. i've on my computer word 2003 and 2000 both. i've referenced PIA's for word 2003. everything is working fine like bookmark,save,open,add,close. but when i am using printout method , on my pc it is running fine. but i am deploying on server and trying to run from client computer ..it s giving error ..comexeption ..library is not registered and hresult#.
Client have word 2000. doesnt have 2003. but all other methods are working in word 2000 . only i m having problem with printout.
If somebody know the solution pls. reply me asap.
Thanks
Hemaxi
|
|
|
|
|
can anyone answer to me?
how can i get info of my connection? like sent or received bytes and pockets, how much is it connected and other info? and how can i connect to adsl trough my application, i am currently connecting through shortcut of connection which is on my desktop so i use:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Process.Start(Environment.SpecialFolder.Desktop + "\Adsl.lnk")
End Sub
This works but i want that in my app i can chose from combobox which connection i want to connect to and that it gets connections that are stored in control panel or whatever and that i connect directly so i don't have to create shortcuts, and that i can see info about connection ad that i can disconnect through a button and other stuff... Pleaseeeeeeeee Help!
Thanks for any help...
|
|
|
|
|
|
not really but thanks for giving even a little help...
|
|
|
|
|
I am trying to set a status column equal to 1 or 3 if it contains certain text in the lineitemnotes column. For example, if lineitemnotes contain the text "refunded" then the status is equal to 1 and if lineitemnotes contain the text "Added During Receiving" then status equal to 3. The problem I am having is it will set the first column with the text "refunded" and all the other stauts columns to 1 until it hit the column with the text "Added During Receiving" then all the status columns will be set to 3. However, I only want the status column to be 1 if the lineitemnites column contains the text "refunded" and status column equal to 3 if lineitemnotes column contains "Added During Receiving". Hope this is understandable. Here is my broke code to give an idea of what I am trying to do.
If Trim(row("wtnumber").ToString()) & Trim(row("wtcustomername").ToString()) = "" Then
If Trim(row("lineitemnotes").ToString.Contains("Refunded")) Then
customername = "Refunded"
status = "1"
ElseIf Trim(row("lineitemnotes").ToString.Contains("Added During Receiving")) Then
customername = "Stock"
status = "3"
End If
End If
I don't know if the contains command is correct or not. Any ideas will help.
jds1207
|
|
|
|
|
What is customername? A String variable? A column name?
Nate Lindley
|
|
|
|
|
customername is a string variable.
Dim customername As String
Dim status As String = vbEmpty
|
|
|
|
|
If the lineitemnotes column will be exactly 'Refunded' or 'Added During Recieving' then try this:
If Trim(row("wtnumber")).ToString() & Trim(row("wtcustomername")).ToString() = "" Then
If Trim(row("lineitemnotes")).ToLower() = "refunded" Then
customername = "Refunded"
status = "1"
ElseIf Trim(row("lineitemnotes")).ToLower() = "Added During Receiving" Then
customername = "Stock"
status = "3"
End If
End If
What exactly are you doing with the variables after you set them each time? If you're trying to iterate through a table and set the fields of the rows (customername, status) then you should be putting this code inside a For Each loop and either submitting each row individually or updating at the end via a dataset. This code should work though as far as checking the row's column for a certain value.
Nate Lindley
|
|
|
|
|
The variables are being inserted into a MySQL database. I am using a For Each Loop. Here is the code:
For Each row In dtTable.Rows
If row("WTNumber").ToString() = "" Then
SoNum = vbEmpty
Else
SoNum = row("WTNumber").ToString()
End If
If Trim(row("wtnumber").ToString()) & Trim(row("wtcustomername").ToString()) = "" Then
If Trim(row("lineitemnotes").ToString.Contains("Refunded")) Then
customername = "Refunded"
status = 1
ElseIf Trim(row("lineitemnotes").ToString.Contains("Added During Receiving")) Then
customername = "Stock"
status = 3
Else
customername = "Stock"
status = 3
End If
End If
Next row
|
|
|
|
|
No, the lineitemnotes column will not be exactly 'Refunded' or 'Added During Recieving', it comtains othe data too.
|
|
|
|
|
I was wondering if you can add a custom class to the My.Settings object. I mean I know you can because I did, but the problem I'm having is the class won't persist ie. the data isn't saved. The only requirment (I thought) was that the object needed to be serializable, which mine is. So am I doing something wrong, or is this just not an option. I looked for a while but just couldn't find an answer or an example. Also as a general rule, if there even is one, what kind of data should I save using the my.settings object? Should I just stick with basics like form location and color settings or is it appropriate to store whatever you want as long as you wish to store it in an xml format?
Here is a very simple class I made for testing.
<Serializable()> _
Public Class TestClass
Public Name As String
Public Sub New(ByVal name As String)
Me.Name = name
End Sub
End Class This is the code I used to extend My.Settings object.
Namespace My
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
<Global.System.Configuration.UserScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute(Nothing)> _
Public Property MyTestClass() As TestClass
Get
Return CType(Me("MyTestClass"), TestClass)
End Get
Set(ByVal value As TestClass)
Me("MyTestClass") = value
End Set
End Property
End Class
End Namespace
|
|
|
|
|
wrote: to anyone who has encounter appforge
If you're asking about something obscure, all the more reason to put it in your subject line, so the subset of CPians who can help, will see it. imagine how useful it would be if all the subject lines were variations on 'help help help'
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Is there a way to put a random letter in a set of labels in vb.net 2005, for example, when i load a program, a different set of letters will show up, only single letters, but different each time???
I want the letters to be from a-z, and be different each time for 10 different labels.
I know you can do random numbers, i wasnt sure about letters, and how they would be stipulated.
Cheers
|
|
|
|
|
just like you doo with numbers... i supose that you need that for joke or some fun...
Private Sub Timer Tick
dim i as integer=random number
GetLatter(i)
End Sub
private sub GetLatter(Byval xInput as integer)
if xInput=0 Then
label1.text="A"
elseif xInput=1 Then
label1.text="B"
End if
End Sub
Hope you understand... :->
|
|
|
|
|
I dont get it!
So your declaring i as an integer, but what is that used for?
Also dont get the get latter bit, how do i loop this through all the letters of the alphabet?
Cheers for the quick response btw, im a bit of a noobie, go easy on me!
|
|
|
|
|
' Create an ArrayList and fill it with ASCII values
Dim salt As New ArrayList
For num As Integer = 65 To 90
salt.Add(num)
Next
Dim rand As New Random()
Dim iPos As Integer = 0
Dim cTemp As Char
While salt.Count > 0
' Get a random position within the ArrayList
' use the Random.Next(min, max)
iPos = CInt(rand.Next(0, salt.Count - 1))
' Retrieve the letter within the ArrayList
' using ArrayList.Item(iPos)
cTemp = Convert.ToChar(CInt(salt.Item(iPos)))
' TODO: cTemp holds your random letter
MsgBox(cTemp.ToString)
' Remove the letter within the ArrayList
' using ArrayList.RemoveAt(iPos)
salt.RemoveAt(iPos)
' Using the above statment will
' decrease the ArrayList.Count
End While
This might be a little easier to under stand. Good luck.
I'm listening but I only speak GEEK.
|
|
|
|
|
now im even more confused!
|
|
|
|
|
Create a random generator:
Dim rnd as New Random()
Get a random character:
Dim c as Char = Convert.ToChar(rnd.Next(65, 91))
Put it in a label:
OneOfMyLabels.Text = c.ToString()
Repeat the last two steps for each label.
---
single minded; short sighted; long gone;
|
|
|
|
|
Yours a star, but:
Do you mean like this:
Dim Chara As Char = Convert.ToChar(rnd.Next(98, 123))
Private Sub frmTestAllRows_Load(ByVal sender As System.Object...
lblLetter1.Text = Chara.ToString()
lblLetter2.Text = Chara.ToString()
lblLetter3.Text = Chara.ToString()
lblLetter4.Text = Chara.ToString()
Cos that makes all the labels the same value!
Also, is there any way to do this for 20labels, without having to write out the statement for linking to the rand for each one
-- modified at 15:20 Tuesday 6th February, 2007
|
|
|
|
|
It's obvious from your answers on this thread that you're pretty new to VB. If you're writing something for some fun, finish this project by all means, but then buy a good book on VB ( the language, not the forms designer ) and work through it.
harveyhanson wrote: lblLetter1.Text = Chara.ToString()
lblLetter2.Text = Chara.ToString()
lblLetter3.Text = Chara.ToString()
lblLetter4.Text = Chara.ToString()
Will obviously make them all the same value.
harveyhanson wrote: Convert.ToChar(rnd.Next(98, 123))
will generate a new random char every time you call it.
You can write code to iterate over the Controls collection and find textboxes and set them. I suspect this is beyond you, and I am not a VB.NET user, so I can't write an example that I can guarentee will work. The other alternative is to write this code for every label on your form, yes.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
harveyhanson wrote: Do you mean like this
No.
I wrote:
Repeat the last two steps for each label.
---
single minded; short sighted; long gone;
|
|
|
|
|
Just create a function that returns a random letter. You should do this.
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
label1.text = RandomLetter()
label2.text = RandomLetter()
'...
End Sub
Dim rnd As New Random
Private Function RandomLetter() As String
Return Chr(rnd.Next(97, 123)).ToString
End Function
Or if you want to dynamically find each label and assign it a random letter use this:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
RandomizeLabels(Me, "Label*")
End Sub
'---Assigns a random letter to each label who's name matches the given pattern---
Dim rnd As New Random
Private Sub RandomizeLabels(ByVal container As Control, ByVal pattern As String)
For Each ctrl As Control In container.Controls
Dim lbl As Label = TryCast(ctrl, Label)
If lbl IsNot Nothing AndAlso lbl.Name Like pattern Then
lbl.Text = Chr(rnd.Next(97, 123)).ToString
End If
Next
End Sub
The above code assumes the labels are on your form and not in another container like a panel. If they are then instead of passing 'me' you should pass the container control like 'panel1'. Also the pattern can be anything. Just give your labels a consistent name such as lblRandom1, lblRandom2...and use a pattern of "lblRandom*".
-- modified at 17:52 Sunday 18th February, 2007
|
|
|
|
|