|
Are you sure it's actually a decimal, and not a string representation of a decimal?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I didn't check that. And I should double check the RDLC, and dataset I made as well.
That's a excellent suggestion.
tableInventoryItems.Columns.Add(New DataColumn("FATD0_Q", Type.GetType("System.Int32")))
tableInventoryItems.Columns.Add(New DataColumn("FATD0_A", Type.GetType("System.Decimal")))
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
jkirkerx wrote:
Type.GetType("System.Int32")
Type.GetType("System.Decimal") NB: You can simplify that to:
tableInventoryItems.Columns.Add(New DataColumn("FATD0_Q", GetType(Integer)))
tableInventoryItems.Columns.Add(New DataColumn("FATD0_A", GetType(Decimal))) GetType Operator - Visual Basic | Microsoft Docs[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I didn't know that.
give it a try, that would be nicer than using a string.
I just compiled it, and deployed it on the customer machine, and all of a sudden it works.
Worked on my machine as well when testing. I changed the enumerator for the sorts to more descriptive names, and that was it.
I don't know.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
hmm, didn't like it.
my Type.GetType wants a string + 7 overloads.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
... typeof( int )
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
|
I think I get it now. Will try it again.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
|
|
|
|
|
I'm using this example from ChilKat, using his dll to connect to a server by ssh. it works perfectly the problem is that i want to run a list of commands from a textbox
VB.NET SSH Remote Shell Multiple Commands[^]
So i have a textbox with some monitoring commands:
<pre> For x = 0 To MonitorCommandsToRun.Lines.Count - 1
' Open a session channel. (It is possible to have multiple
' session channels open simultaneously.)
channelNum = ssh.OpenSessionChannel()
If (channelNum < 0) Then
output.AppendText(ssh.LastErrorText & vbNewLine)
Exit Sub
End If
success = ssh.SendReqShell(channelNum)
If (success <> True) Then
output.AppendText(ssh.LastErrorText & vbNewLine)
Exit Sub
End If
success = ssh.ChannelSendString(channelNum, MonitorCommandsToRun.Lines(x).ToString & vbCrLf, "ansi")
If (success <> True) Then
output.AppendText(ssh.LastErrorText & vbNewLine)
Exit Sub
End If
' Retrieve and display the output.
success = ssh.ChannelReceiveUntilMatch(channelNum, myPrompt, "ansi", True)
If (success <> True) Then
output.AppendText(ssh.LastErrorText & vbNewLine)
Exit Sub
End If
cmdOutput = ssh.GetReceivedText(channelNum, "ansi")
If (ssh.LastMethodSuccess <> True) Then
output.AppendText(ssh.LastErrorText & vbNewLine)
Exit Sub
End If
success = ssh.ChannelSendEof(channelNum)
If (success <> True) Then
output.AppendText(ssh.LastErrorText & vbNewLine)
Exit Sub
End If
n = ssh.ChannelReadAndPoll(channelNum, pollTimeoutMs)
If (n < 0) Then
output.AppendText(ssh.LastErrorText & vbNewLine)
Exit Sub
End If
' Close the channel:
success = ssh.ChannelSendClose(channelNum)
If (success <> True) Then
output.AppendText(ssh.LastErrorText & vbNewLine)
Exit Sub
End If
output.AppendText(cmdOutput & vbNewLine)
Next
this looks ugly and the program hangs, not sure if i need to remove the channelNum check or avoid closing it but i just want it to resume doing one command per line.
My entire code is like chilkat's with this for inside it.
thanks in advance
|
|
|
|
|
Private Sub btnTotalCost_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTotalCost.Click
lblTotalCost.Text = "YOU HAVE ORDERED:" & vbNewLine
lblTotalCost.Text = lblTotalCost.Text & "ROOM TYPE" & vbNewLine & "--------" & vbNewLine
If radLuxury.Checked Then
lblTotalCost.Text = lblTotalCost.Text & "Luxury = $210" & vbNewLine
ElseIf radSuperior.Checked Then
lblTotalCost.Text = lblTotalCost.Text & "Superior = $150" & vbNewLine
Else
lblTotalCost.Text = lblTotalCost.Text & "Standard = $110" & vbNewLine
End If
lblTotalCost.Text = lblTotalCost.Text & vbNewLine & "MEAL OPTIONS" & vbNewLine & "--------" & vbNewLine
If chkBufferBreakfast.Checked Then
lblTotalCost.Text = lblTotalCost.Text & "Buffer Breakfast = $40" & vbNewLine
End If
If chkBufferDinner.Checked Then
lblTotalCost.Text = lblTotalCost.Text & "Buffer Dinner = $60" & vbNewLine
End If
lblTotalCost.Text = lblTotalCost.Text & vbNewLine & "AMENITIES" & vbNewLine & "--------" & vbNewLine
If chkInternet.Checked Then
lblTotalCost.Text = lblTotalCost.Text & "Internet = $10" & vbNewLine
End If
If chkEntertainment.Checked Then
lblTotalCost.Text = lblTotalCost.Text & "Entertainment = $20" & vbNewLine
End If
If chkSpaServices.Checked Then
lblTotalCost.Text = lblTotalCost.Text & "Spa Services = $50" & vbNewLine
End If
End Sub
|
|
|
|
|
|
WELL, I WAnt to create a project in vb6 regarding a leap year (user will enter any year and the computer will have identify if that is a leap year or not).
|
|
|
|
|
Permission granted.
Why on earth are you using VB6? It's been dead for quite a long time now.
|
|
|
|
|
|
Devam Dani wrote: WELL, I WAnt to create a project in vb6 No.
No. Thousand times, no. You don't.
VB.NET is available for free, and would run on any platform that supports VB6. You don't write anything "new" in VB6. There's not even an excuse to do so. Anyone who does should be punished. Not just with jail, but with torture.
Also sounds like a school-assignment; if it is, find a new school - dump them today, without explanation. VB6 is dead for a long time, and there's better and free alternatives. VB6 was never free. If you see a copy, it is probably a pirated one.
If it is a school, please contact me.
But no. Not ever should you write in VB6. If the devil comes and demands it; say no and tell him it is out of service. No longer supported.
VB's not pinin'! 'B's passed on! This language is no more! It has ceased to be! 'VB6's expired and gone to meet its maker! 'VB6's a stiff! Bereft of life, 'B rests in pieces! If you hadn't nailed it to the perch VB6'd be pushing up the daisies! Its metabolic processes are now history! VB6's off the twig! VB6's kicked the bucket, VB6 shuffled off its mortal coil, run down the curtain and joined the bleedin' choir invisible!! THIS IS AN EX-LANGUAGE!!
No. No. No.
Devam Dani wrote: user will enter any year and the computer will have identify if that is a leap year or not Easy.
But VB6? No. We don't even discuss it. Just, no.
Would be simple in the free VB.NET, but VB6?
No.
Did I mention VB6 is a bad idea? For everything? Whatever your question on VB6, the answer is
noIf it is a school, ask your fakkin' money back. Send me their address; I will have a word. Or DWORD. Or several. ..but I will close them if this their modus operandi.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Loving the Monty Python references
|
|
|
|
|
It sounds.. a bit excessive.
It was a bad day. And the bad days outnumber me.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Data Visualization is important because with the help of it we can get a clear idea about the information.
|
|
|
|
|
Uh yeah, thanks for the public service announcement, I guess??
Did you have a question on this or did you just want to state the obvious?
|
|
|
|
|
Buongiorno a tutti come potete vedere ne codice ho un insert into in database in un datatable con 24 campi vorrei assegnare i parametri della funzione alle rows mediante un loop ma non riesco davvero a capire come posso fare se per favore qualcuno mi puo aiutare .
Vi ringrazio e posto il codice:
<ComponentModel.DataObjectMethod(ComponentModel.DataObjectMethodType.Insert, True)>
Public Function InsertValorePrevisto(ByVal ValorePrevistoPezzoUno As String,
ByVal ValorePrevistoPezzoDue As String, ByVal ValorePrevistoPezzoTre As String,
ByVal ValorePrevistoPezzoQuattro As String, ByVal ValorePrevistoPezzoCinque As String,
ByVal ValorePrevistoPezzoSei As String,ByVal ValorePrevistoPezzoSette As String,
ByVal ValorePrevistoPezzoOtto As String, ByVal ValorePrevistoPezzoNove As String,
ByVal ValorePrevistoPezzoDieci As String, ByVal ValorePrevistoPezzoUndici As String,
ByVal ValorePrevistoPezzoDodici As String,ByVal ValorePrevistoPezzoTredici As String,
ByVal ValorePrevistoPezzoQuattordici As String, ByVal ValorePrevistoPezzoQuindici As String,
ByVal ValorePrevistoPezzoSedici As String, ByVal ValorePrevistoPezzoDiciasette As String,
ByVal ValorePrevistoPezzoDiciotto As String,ByVal ValorePrevistoPezzoDiciannove As String,
ByVal ValorePrevistoPezzoVenti As String) As Integer
Dim IDIntestazione As Integer = PropIdIntestazione
Dim NumOrdine As String = PropNumeroOrdine
Dim CodArticolo As String = PropCodiceArticolo
Dim RigaOrdNum As Integer = PropRigaOrdNum
Dim ValorePrevisto As New dbGestTestReport6DataSet.tblValPrevistiDataTable
Dim ValorePrevistoRow As dbGestTestReport6DataSet.tblValPrevistiRow =ValorePrevisto.NewtblValPrevistiRow
ValorePrevistoRow.IDIntestazione = IDIntestazione
ValorePrevistoRow.NumOrdine = NumOrdine
ValorePrevistoRow.CodArticolo = CodArticolo
ValorePrevistoRow.RigaOrdNum = RigaOrdNum
ValorePrevistoRow.ValorePrevistoPezzoUno = ValorePrevistoPezzoUno
ValorePrevistoRow.ValorePrevistoPezzoDue = ValorePrevistoPezzoDue
ValorePrevistoRow.ValorePrevistoPezzoTre = ValorePrevistoPezzoTre
ValorePrevistoRow.ValorePrevistoPezzoQuattro = ValorePrevistoPezzoQuattro
ValorePrevistoRow.ValorePrevistoPezzoCinque = ValorePrevistoPezzoCinque
ValorePrevistoRow.ValorePrevistoPezzoSei = ValorePrevistoPezzoSei
ValorePrevistoRow.ValorePrevistoPezzoSette = ValorePrevistoPezzoSette
ValorePrevistoRow.ValorePrevistoPezzoOtto = ValorePrevistoPezzoOtto
ValorePrevistoRow.ValorePrevistoPezzoNove = ValorePrevistoPezzoNove
ValorePrevistoRow.ValorePrevistoPezzoDieci = ValorePrevistoPezzoDieci
ValorePrevistoRow.ValorePrevistoPezzoUndici = ValorePrevistoPezzoUndici
ValorePrevistoRow.ValorePrevistoPezzoDodici = ValorePrevistoPezzoDodici
ValorePrevistoRow.ValorePrevistoPezzoTredici = ValorePrevistoPezzoTredici
ValorePrevistoRow.ValorePrevistoPezzoQuattordici = ValorePrevistoPezzoQuattordici
ValorePrevistoRow.ValorePrevistoPezzoQuindici = ValorePrevistoPezzoQuindici
ValorePrevistoRow.ValorePrevistoPezzoSedici = ValorePrevistoPezzoSedici
ValorePrevistoRow.ValorePrevistoPezzoDiciasette = ValorePrevistoPezzoDiciasette
ValorePrevistoRow.ValorePrevistoPezzoDiciotto = ValorePrevistoPezzoDiciotto
ValorePrevistoRow.ValorePrevistoPezzoDiciannove = ValorePrevistoPezzoDiciannove
ValorePrevistoRow.ValorePrevistoPezzoVenti = ValorePrevistoPezzoVenti
ValorePrevisto.AddtblValPrevistiRow(ValorePrevistoRow)
Dim rowsAffected As Integer = AdapterValorePrevisto.Update(ValorePrevisto)
Return rowsAffected
End Function
|
|
|
|
|
This is an English speaking site.
Translated:
Quote: Good morning everyone as you can see in code I have an insert into database in a datatable with 24 fields I would like to assign the parameters of the function to rows through a loop but I can not really understand how I can do if please someone can help me .
Thank you and put the code:
You don't have any reasonable possibility of a loop. You could rewrite all of this and use a structure or collection to hold all the values and which fields they go to, but then you'd lose performance when you try to assign all these values because you'd need to use Reflection to identify the properties in the "ValorePrevistoRow" object to assign the values to.
|
|
|
|
|
Hi Dave
First sorry for the post in Italian I had not thought about it, thanks for the reply, in fact you can confirm what I suspected. This application would have to be completely redone in WPF and Entity Framework.
Thanks so much
Fabrizio
|
|
|
|
|
Fabrizio Leoncini wrote: First sorry for the post in Italian I had not thought about it The code is even in Italian. Why??
Fabrizio Leoncini wrote: This application would have to be completely redone in WPF and Entity Framework. There you find the exact same problem. But please, go ahead and try first.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Quote: The code is even in Italian. The code is in VB.NET. The variable names are in Italian Quote: Why?? Possibly because the OP is Italian??? Maybe.
It's true, I have been called a pedantic little elephant many times
|
|
|
|
|
CHill60 wrote: The code is in VB.NET. The variable names are in Italian True
CHill60 wrote: Possibly because the OP is Italian??? Maybe. Makes it harder to communicate the codes intentions.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|