|
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.
|
|
|
|
|
hello everyone.
i am try to draw up a simple timer into a userform. having red doevent command can fit this purpose, i wrote below code:
Option Explicit
Public Esci As Boolean
Private Sub CommandButton1_Click()
Esci = True
End Sub
Private Sub UserForm_Activate()
Dim countdown As Integer, i As Integer
countdown = 10
Me.Label2.Caption = countdown
Stop '<----- to check macro running only
For i = 1 To 10
VBA.DoEvents
Application.Wait (Now + TimeValue("0:00:01"))
countdown = countdown - 1
Me.Label2.Caption = countdown
If Esci = True Then
MsgBox ("CIAOOOOO")
Exit Sub
End If
Next
End Sub
now, doevents should set the compiler to keep "listening" other routine running while executing for next loop.
however, even if i press commandbutto1 to change boolean variable "esci" from false to true and exit the routine, nothing happens and the loop end up regardless boolean value. what i wrong? thanks
|
|
|
|
|
First, VBA is interpreted, not compiled. There is no compiler in any of the Office apps for VBA.
DoEvents doesn't do what you think it does. DoEvents stops your code from running and processes any pending messages that have queued up and sends any keys in the SendKeys queue. Then your code resumes.
A better solution would be to use Application.OnTime. This will raise an event in your code that you can use to call a function in your UserForm to do whatever you need to do. No DoEvents required at all.
See this on SO[^] for an example and couple of alternatives if that doesn't meet your needs.
|
|
|
|
|
Thanks a lot for your suggestion. I ll try.
|
|
|
|
|
I have applied sorting to the columns of a gridview and it works fine. There is a command field ShowEditButton to allow the user to update a record. In the code behind, the RowEditing and RowCancelingEdit also work as intended. The problem is the RowUpdating event. When the event fires the row in the database does get updated, but the gridview continues to show the previous value. The page actually has to unload and reload to show the new value. If anyone has any idea how to overcome this issue it sure would be appreciated.
Gridview:
<asp:GridView ID="grdSeries" runat="server" AutoGenerateColumns="False" DataKeyNames="SeriesChrCode, ProductLine, ProcurementType" AllowSorting="true">
<Columns>
<asp:CommandField ShowEditButton="True" CausesValidation="False"/>
<asp:BoundField HeaderText="SeriesChrCode" ReadOnly="True" Visible="False" DataField="SeriesChrCode"/>
<asp:BoundField HeaderText="ProductLine" ReadOnly="True" Visible="False" DataField="ProductLine"/>
<asp:BoundField HeaderText="ProcurementType" ReadOnly="True" Visible="False" DataField="ProcurementType"/>
<asp:TemplateField HeaderText="Character Code" ItemStyle-HorizontalAlign="Center" SortExpression="SeriesChrCode">
<ItemTemplate><asp:Label ID="lblSeriesChrCode" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "SeriesChrCode") %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" ID="edit_SeriesChrCode" MaxLength="15" Text='<%#Bind(Container.DataItem, "SeriesChrCode") %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="ProductLine" ItemStyle-HorizontalAlign="Center" SortExpression="ProductLine">
<ItemTemplate><asp:Label ID="lblProductLine" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "ProductLine") %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList runat="server" ID="edit_ProductLine" selectedvalue='<%#Bind(Container.DataItem, "ProductLine") %>' DataTextField="ProductLine" DataValueField="ProductLine" datasource ='<%# GetProductLines %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="ProcurementType" ItemStyle-HorizontalAlign="Center" SortExpression ="ProcurementType">
<ItemTemplate><asp:Label ID="lblProcurementType" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "ProcurementType") %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList runat="server" ID="edit_ProcurementType" selectedvalue='<%#Bind(Container.DataItem, "ProcurementType") %>' DataTextField="ProcurementType" DataValueField="ProcurementType" datasource ='<%# GetProcurementTypes %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Series Code Description" ItemStyle-HorizontalAlign="Center" SortExpression ="SeriesCodeDescription">
<ItemTemplate><asp:Label ID="lblSeriesCodeDescription" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "SeriesCodeDescription") %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" ID="edit_SeriesCodeDescription" MaxLength="50" Text='<%#Bind(Container.DataItem, "SeriesCodeDescription") %>' />
</EditItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
RowEditing and RowCancelEdit subs (both work):
Private Sub grdSeries_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles grdSeries.RowCancelingEdit
grdSeries.EditIndex = -1
Dim o As New clsData
Dim dt As DataTable = o.GetSeries
grdSeries.DataSource = dt
grdSeries.DataBind()
'*************
'works fine
If Not IsNothing(Session("LastSort")) Then
Dim dv As DataView = Session("LastSort")
grdSeries.DataSource = dv
grdSeries.DataBind()
End If
End Sub
Private Sub grdSeries_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles grdSeries.RowEditing
grdSeries.EditIndex = CInt(e.NewEditIndex)
Dim o As New clsData
Dim dt As DataTable = o.GetSeries
grdSeries.DataSource = dt
grdSeries.DataBind()
'*************
'works fine
If Not IsNothing(Session("LastSort")) Then
Dim dv As DataView = Session("LastSort")
grdSeries.DataSource = dv
grdSeries.DataBind()
End If
End Sub
RowUpdating (not rendering in grid):
Private Sub grdSeries_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles grdSeries.RowUpdating
Dim o As New clsData
'get the id of the row being updated
'product line and procurementtype are updateable
'they are also the primary key
Dim strSeriesChrCode As String = grdSeries.DataKeys(e.RowIndex).Values("SeriesChrCode")
Dim strProductLine As String = grdSeries.DataKeys(e.RowIndex).Values("ProductLine")
Dim strProcurementType As String = grdSeries.DataKeys(e.RowIndex).Values("ProcurementType")
Dim cntrl_0 As TextBox
cntrl_0 = CType(grdSeries.Rows(e.RowIndex).FindControl("edit_SeriesChrCode"), TextBox)
Dim strCntrl_0 As String = cntrl_0.Text
Dim cntrl_1 As DropDownList
cntrl_1 = CType(grdSeries.Rows(e.RowIndex).FindControl("edit_ProductLine"), DropDownList)
Dim strCntrl_1 As String = cntrl_1.Text
Dim cntrl_2 As DropDownList
cntrl_2 = CType(grdSeries.Rows(e.RowIndex).FindControl("edit_ProcurementType"), DropDownList)
Dim strCntrl_2 As String = cntrl_2.Text
Dim cntrl_3 As TextBox
cntrl_3 = CType(grdSeries.Rows(e.RowIndex).FindControl("edit_SeriesCodeDescription"), TextBox)
Dim strCntrl_3 As String = cntrl_3.Text
Dim b As Boolean = o.UpdateSeries(strCntrl_0, strCntrl_1, strCntrl_2, strCntrl_3, strSeriesChrCode, strProductLine, strProcurementType)
grdSeries.EditIndex = -1
'*******************
'sort order is ok and data is updated on backend but does not show on the front end
Dim dt As DataTable = o.GetSeries
grdSeries.DataSource = dt
grdSeries.DataBind()
If Not IsNothing(Session("LastSort")) Then
Dim dv As DataView = Session("LastSort")
grdSeries.DataSource = dv
grdSeries.DataBind()
End If
End Sub
|
|
|
|
|
The gridview doesn't automatically know what the database does; it may be updating a lot more, based on sprocs and triggers. Easiest and most used solution is to reload the grid.
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.
|
|
|
|
|
The link to NArrange does not seem to work anymore. Does anyone know where I can now get it, or is it defunct (now that 11 yesrs have passed since last update?)
|
|
|
|
|
Did you try looking for it on Nuget?
|
|
|
|
|
How code to Print a Bit map image to pos printer via comport in VB6
|
|
|
|
|
|
Simples, you don't. VB6 is no longer supported, and hasn't been for years. There's free alternatives available that can easily be integrated into your VB6-application. It'll be hard to find documentation on integrating since there's no one doing that anymore; but even with limited info, you should be able to launch an executable and retrieve its output for processing.
Now if you excuse me, I'm going to wash my hands.
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.
|
|
|
|
|
Hello Fellow Members,
Please I work in a company where land/site plans are used. These plans have coordinates on them. I want these coordinates to be entered which Google will take you to the exact plot.
In fact, any sample code or links will be welcomed.
Thanks
|
|
|
|
|
What have you tried?
Where are you stuck?
What help do you need?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
There's free geolocation databases, but not even Google pretends to be "exact".
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.
|
|
|
|
|