Click here to Skip to main content
15,436,002 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHow can my app look the same on all machines? Pin
Member 146743679-Dec-19 14:17
MemberMember 146743679-Dec-19 14:17 
AnswerRe: How can my app look the same on all machines? Pin
CHill6010-Dec-19 1:46
mveCHill6010-Dec-19 1:46 
AnswerRe: How can my app look the same on all machines? Pin
Dave Kreskowiak10-Dec-19 4:59
mveDave Kreskowiak10-Dec-19 4:59 
AnswerRe: How can my app look the same on all machines? Pin
Gerry Schmitz10-Dec-19 8:14
mveGerry Schmitz10-Dec-19 8:14 
QuestionHow can I get an free installer that registers .dll and .ocx components as I install my app? Pin
Member 146743679-Dec-19 14:17
MemberMember 146743679-Dec-19 14:17 
AnswerRe: How can I get an free installer that registers .dll and .ocx components as I install my app? Pin
CHill6010-Dec-19 1:44
mveCHill6010-Dec-19 1:44 
AnswerRe: How can I get an free installer that registers .dll and .ocx components as I install my app? Pin
gvidali7-Feb-20 3:09
Membergvidali7-Feb-20 3:09 
Question[Solved] - How to retrieve value inserted to variable Pin
nrdroque5-Dec-19 23:26
Membernrdroque5-Dec-19 23:26 
hi every one i have this code to generate a sequential serial number.
and have another private sub to retrive the last inserted serial number
is it possible to do that in this one?


VB
<pre>    Private Sub Gera2d()

        Try
            data = DateAndTime.Now
            Dim con As New SqlConnection
            Dim sql_query As New SqlCommand
            '
            Dim sql_result As SqlDataReader
            '
            con.ConnectionString = "server='" & SqlServer & "';Database=etiquetasKLC;Uid='" & SqlUser & "';PWD='" & Sqlpassword & "';"
            sql_query.Connection = con
            con.Open()
            sql_query.Parameters.Add("@posto", SqlDbType.NVarChar).Value = posto
            sql_query.Parameters.Add("@data", SqlDbType.NVarChar).Value = data
            sql_query.Parameters.Add("@lote", SqlDbType.NVarChar).Value = ordemFabrico
            sql_query.Parameters.Add("@versao", SqlDbType.NVarChar).Value = status
            sql_query.Parameters.Add("@indexnumber", SqlDbType.NVarChar).Value = cavidade + indexnumber
            sql_query.Parameters.Add("@semana", SqlDbType.NVarChar).Value = weekyear
            sql_query.Parameters.Add("@qrgerado", SqlDbType.NVarChar).Value = codigoQr
            sql_query.Parameters.Add("@operador", SqlDbType.NVarChar).Value = op
            sql_query.Parameters.Add("@partnumber", SqlDbType.NVarChar).Value = partnumber
            sql_query.Parameters.Add("posx", SqlDbType.NVarChar).Value = labelx
            sql_query.Parameters.Add("posy", SqlDbType.NVarChar).Value = labely
            sql_query.Parameters.Add("ip_impressora", SqlDbType.NVarChar).Value = enderecoimpressora
            sql_query.CommandText = "INSERT INTO etiquetas with (tablockx)(nome_posto, data, lote, serialnumber,partnumber,versao,indexnumber,semana, qrgerado,operador,snpn,posx,posy,impressora) select top (1) @posto,
            @data,@lote,T.x,@partnumber,@versao, @indexnumber,@semana, T.x+@partnumber+@versao+@indexnumber+@semana, @operador, T.x+@partnumber, @posx,@posy,@ip_impressora
            FROM [etiquetas] x CROSS APPLY (VALUES(format(convert(int,x.serialnumber)+1,'0000000')))T(x) where partnumber like @partnumber  order by id desc ;"

            sql_query.Parameters.AddWithValue("@sn", serialnumber)

            serialnumber = sql_query.ExecuteScalar()

            Try

                If sql_query.ExecuteScalar() <> 0 Then
                    serialnumber = serialnumber
                End If

            Catch ex As Exception
                IO.File.AppendAllText("C:\ti\Log.txt", String.Format("{0}{1}", Environment.NewLine, Now() + " - " + ex.ToString()))

            End Try
            con.Close()
        Catch ex As Exception

            MsgBox(ex.Message)
        End Try
    End Sub


modified 17-Dec-19 11:12am.

AnswerRe: How to retrieve value inserted to variable Pin
dan!sh 6-Dec-19 0:41
professional dan!sh 6-Dec-19 0:41 
AnswerRe: How to retrieve value inserted to variable Pin
Richard Deeming6-Dec-19 1:05
mveRichard Deeming6-Dec-19 1:05 
GeneralRe: How to retrieve value inserted to variable Pin
nrdroque6-Dec-19 3:40
Membernrdroque6-Dec-19 3:40 
GeneralRe: How to retrieve value inserted to variable Pin
Eddy Vluggen6-Dec-19 8:49
professionalEddy Vluggen6-Dec-19 8:49 
QuestionMS Chart is adding extra X axis when doing multiple series. Pin
Member 1435926026-Nov-19 8:31
MemberMember 1435926026-Nov-19 8:31 
QuestionHow to determine specific object from Msg.HWnd 'MESSAGE CLOSED' Pin
mo149225-Nov-19 2:32
Membermo149225-Nov-19 2:32 
AnswerRe: can not find the pin Pin
Richard MacCutchan17-Nov-19 21:17
mveRichard MacCutchan17-Nov-19 21:17 
Questiongroup by name for sum amount Pin
Member 1332257413-Nov-19 19:39
MemberMember 1332257413-Nov-19 19:39 
AnswerRe: group by name for sum amount Pin
Dave Kreskowiak14-Nov-19 2:40
mveDave Kreskowiak14-Nov-19 2:40 
Questioncode project data base Pin
abuahmed20191-Nov-19 4:24
Memberabuahmed20191-Nov-19 4:24 
AnswerRe: code project data base Pin
Dave Kreskowiak1-Nov-19 5:00
mveDave Kreskowiak1-Nov-19 5:00 
QuestionSystem.IO.IOException HResult=0x80131620 When using NetworkStream.Read function Pin
fd975029-Oct-19 22:48
professionalfd975029-Oct-19 22:48 
AnswerRe: System.IO.IOException HResult=0x80131620 When using NetworkStream.Read function Pin
Richard MacCutchan29-Oct-19 23:09
mveRichard MacCutchan29-Oct-19 23:09 
GeneralRe: System.IO.IOException HResult=0x80131620 When using NetworkStream.Read function Pin
fd975029-Oct-19 23:23
professionalfd975029-Oct-19 23:23 
GeneralRe: System.IO.IOException HResult=0x80131620 When using NetworkStream.Read function Pin
fd975030-Oct-19 0:02
professionalfd975030-Oct-19 0:02 
QuestionHow to solve problem with datagrid and tabcontrol(vb.net) Pin
Member 1447080727-Oct-19 22:52
MemberMember 1447080727-Oct-19 22:52 
AnswerRe: How to solve problem with datagrid and tabcontrol(vb.net) Pin
Richard MacCutchan27-Oct-19 23:14
mveRichard MacCutchan27-Oct-19 23:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.