|
Well, finding a php forum seems to be your first challenge. PHP is not VB in any way, shape or form.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
This is a VB.NET forum. Try a PHP forum
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Im trying to debug a function in VB
My code looks like this. When I call Dim Ip as Int64 = GetLocId("192.168.1.1, cn) I get error "Syntax error or access violation" Its got to be something stupid I am doing.
Namespace Ip
Public Class Class1
Public Function GetLocId(ByVal Ip As String, ByVal connection As String) As Int64
Dim cn As System.Data.OleDb.OleDbConnection = New System.Data.OleDb.OleDbConnection(connection)
Dim command As String = "EXEC [dbo].[sp_location_i]"
'Dim IpId As Int64
Dim IpLocId As Int64
cn.Open()
Dim cmd As System.Data.OleDb.OleDbCommand = cn.CreateCommand()
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = command
Dim pIp As OleDbParameter = cmd.Parameters.Add("@Ip", OleDb.OleDbType.VarChar, 15)
pIp.Value = Ip
Dim pIpLocId As OleDbParameter = cmd.Parameters.Add("@IpLocId", OleDbType.BigInt)
pIpLocId.Direction = ParameterDirection.Output
'Try
cmd.ExecuteNonQuery()
'Catch exc As OleDbException
' Console.WriteLine(exc.Message)
' IpLocId = 0 --Unknow location
'Finally
cn.Close()
'End Try
IpLocId = Convert.ToInt64(pIpLocId.Value)
Return IpLocId
End Function
End Class
End Namespace
|
|
|
|
|
I think problem is with this :-
DerekFL wrote: Dim command As String = "EXEC [dbo].[sp_location_i]"
Change the Dim command line to Dim command as String = "dbo.sp_location_i" . leave out the EXEC .
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Thanks Steve. I knew it was something stupid.
|
|
|
|
|
Hi friends,
I need help in opening a msword file from vb.net2005
to a particular Bookmark of the word document .
Please help me to complete this task..
Thanks ,
Chaitanya
|
|
|
|
|
Hi Chaitanya,
Refer to the following links:
Link #1[^]
Link #2[^]
Link #3[^]
Link #4[^]
I hope this would be helpful.
John Adams
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
How we generate a help file for a window base project
and how we use it
Thanks and Regards
Amit Battan Ror
Amit Battan Ror
battan20@gmail.com
|
|
|
|
|
One more question that Google can answer for you... did you try there?
Giving out your mail id as you have is an invitation to spammers
|
|
|
|
|
create your help file in the .rtf format
1.
go to
program files-> visual studio 6.0-> visual studio 6.0 tools-> help workshop
follow the options.
2. search the google and try for 3rd party help makers.
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
How we create a customize setup of vb6 project
means while installing the project image comes on screen should be of our own choice
Thanks and Regards
Amit Battan Ror
Amit Battan Ror
battan20@gmail.com
|
|
|
|
|
Amit Battan Ror wrote: How we create a customize setup of vb6 project
means while installing the project image comes on screen should be of our own choice
There are many installer creator programs available - MS Installer (creates MSI files), InnoSetup (open source), or if you feel more adventurous try InstallShield.
|
|
|
|
|
can you give me download link of these installer
Amit Battan Ror
battan20@gmail.com
|
|
|
|
|
Except InnoSetup which is open source, you need to pay for the others...
You really need to learn to use Google, if you want to get anywhere with these types of questions
|
|
|
|
|
Question: how do I get this to work with Option strict On ?
I'll add a bunch of ToolstripMenuitems(dropdowns) at runtime and need to point them to ONE single click event handler
It "all" works with Option strict turned off .. but the compiler dosn't like it with Option strict turned ON
If I change in the event handler sub
ByVal sender As ToolStripMenuItem
to
ByVal sender As Object
The compiler complains inside the sub when trying to read the
[sender.Text] value ...
Whats missing ? I know it dosn't like the narrowing - but I don't know how to fix it ....
Dim test As New ToolStripMenuItem
AddHandler test.Click, AddressOf IO_selected ' ** handler to be added **
InputsToolStripMenuItem.DropDownItems.Add(test)
Private Sub IO_selected(ByVal sender As ToolStripMenuItem, ByVal e As System.EventArgs)
IODataView.CurrentCell.Value = sender.Text
End Sub
Thanks
Georg
|
|
|
|
|
Georg Kohler wrote: If I change in the event handler sub
ByVal sender As ToolStripMenuItem
to
ByVal sender As Object
That's because when the event is fired, it's epecting the handlers signature to be an exact match to what it expects. sender MUST be declared as Object .
Georg Kohler wrote: The compiler complains inside the sub when trying to read the
[sender.Text] value ...
Obviously, the type Object doesn't have a Text property. So, you have to check for and cast the sender to the type you want. Get used to this, it's pretty common to do this:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim sentMenuItem As ToolStripMenuItem
If TypeOf sender Is ToolStopMenuItem Then
sentMenuItem = DirectCast(sender, ToolStripMenuItem)
End If
IODataView.CurrentCell.Value = sentMenuItem.Text
|
|
|
|
|
Thanks - that makes sense
|
|
|
|
|
Hey all,
I am trying to get Julijan's 3D Pie chart working with values read from a database in VB.NET. This is a sample of the information needed to build the chart:
PieChartControl1.Values = New Decimal() {25, 15, 5, 135}
PieChartControl1.SliceRelativeDisplacements = New Single() {0.1F, 0.2F, 0.2F, 0.2F}
PieChartControl1.Texts = New String() {"red", "green", "yellow", "blue"}
PieChartControl1.ToolTips = New String() {"Peter", "Paul", "Mary", "Brian"}
what I need to do is something like this:
PieChartControl1.Values = New Decimal() {arrValues}
PieChartControl1.SliceRelativeDisplacements = New Single() {arrSlice}
PieChartControl1.Texts = New String() {arrTexts}
PieChartControl1.ToolTips = New String() {arrTooltips}
However, the arraylists cannot be converted to the respective required types (decimal, single, and strings). I dont get how to append the arraylists to the PieChartControl. Help!
|
|
|
|
|
If possible you should not use ArrayLists at all. If you use framework 2 or later, use List<decimal>, List<single> and List<string>, then you can simply feed them to the constructors:
PieChartControl1.Values = New Decimal(values)
PieChartControl1.SliceRelativeDisplacements = New Single(slices)
PieChartControl1.Texts = New String(texts)
PieChartControl1.ToolTips = New String(tooltips)
(Note: VB.NET is a strongly typed language. There isn't really any reason to use hungarian notation to keep track of the data types of variables...)
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
thank you very must for posting. Very sorry, but I don't quite understand how I would do that. I am using some looping statements to create the array lists. I have never worked with LIST before.
How do I declare it? can I just ListName.Add?
If I do the following, I get an error:
Dim ListValues As New List(Of Decimal)
...
code blocks
...
ListValues.Add(decValue)
PieChartControl1.Values = New Decimal() {ListValues}
"Value of type 'System.Collections.Generic.List(Of Decimal)' cannot be converted to 'Decimal'."
|
|
|
|
|
Tom Henkel wrote: PieChartControl1.Values = New Decimal() {ListValues}
Do as I showed you:
PieChartControl1.Values = New Decimal(ListValues)
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
hi i'm using vb.net 2003 version.I have added 4 items to the list using collection property.On some condition i need to disable a particular item (say for ex. item no 2) in the combo box list items so that user can't able to select this item.
pls suggest me the solution.
|
|
|
|
|
I am not aware of any way to disable an item other than removing it form the list completely.
|
|
|
|
|
Off of the top of my head I can think of two ways you can do this. These aren't are the most efficient and exactly how your program works will determine if either is good for you:
1) If the item can't be selected temporarily remove it form the list box. When certain conditions are met, re-add it.
2) When the user selects an item, check if the index of the selected items is one of the ones that can't be selected. If so, change the selected index to the next selectable one.
Hope this help or at least points you in the right direction.
|
|
|
|
|
Thanks For ur suggestion.
I can do removing items from list...but
for some particular condition if i remove the items, combo box wil
be left with one single item...i thought it doesn't look good...
so thought of disabling items instead of removing...
|
|
|
|