Click here to Skip to main content
15,885,278 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to perform non-case search in DataGridViewComboBoxColumn Pin
CHill605-Sep-19 0:02
mveCHill605-Sep-19 0:02 
GeneralRe: How to perform non-case search in DataGridViewComboBoxColumn Pin
mo14925-Sep-19 5:42
mo14925-Sep-19 5:42 
QuestionLinq, GroupBy, Select, First() or Last() Pin
jkirkerx28-Aug-19 12:38
professionaljkirkerx28-Aug-19 12:38 
AnswerRe: Linq, GroupBy, Select, First() or Last() Pin
Maciej Los28-Aug-19 21:24
mveMaciej Los28-Aug-19 21:24 
GeneralRe: Linq, GroupBy, Select, First() or Last() Pin
jkirkerx29-Aug-19 6:59
professionaljkirkerx29-Aug-19 6:59 
AnswerRe: Linq, GroupBy, Select, First() or Last() Pin
Richard Deeming29-Aug-19 7:14
mveRichard Deeming29-Aug-19 7:14 
GeneralRe: Linq, GroupBy, Select, First() or Last() Pin
jkirkerx29-Aug-19 8:32
professionaljkirkerx29-Aug-19 8:32 
QuestionTrying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Augusto10026-Aug-19 6:51
Augusto10026-Aug-19 6:51 
Imports System.Data.SqlClient
Public Class Equipos_de_Computacion
    Dim sql As String = ""


    Private Sub BtnInsertar_Click(sender As Object, e As EventArgs) Handles btnInsertar.Click
        If (Me.txtCodigoInterno.Text = "") Then
            MsgBox("El campo idententificacion no puede estar vacio", MsgBoxStyle.Critical, "Atencion")
            Me.txtCodigoInterno.Select()
        Else
            Dim CodigoInterno As Integer
            Dim NumerodeSerie As Integer
            Dim NumerodeFactura As Integer
            Dim FechadeCompra As Date
            Dim Precio As Decimal
            Dim Acargode As String = ""
            Dim Estado As String = ""
            Dim Depreciacion As Decimal
            Dim Caracteristicas As String = ""


            CodigoInterno = CInt(Me.txtCodigoInterno.Text)
            NumerodeSerie = CInt(Me.txtNumerodeSerie.Text)
            NumerodeFactura = CInt(Me.txtNumerodeFactura.Text)
            FechadeCompra = CDate(Me.DateTimePicker1.Value)
            Precio = Me.nudPrecio.Value
            Acargode = Me.txtACargode.Text
            Estado = Me.txtEstado.Text
            Depreciacion = Me.NudDepreciacion.Value
            Caracteristicas = Me.txtCaracteristicas.Text

            cmd.CommandType = CommandType.Text
            cmd.Connection = conn

            sql = "INSERT INTO [Equipos de Computacion] (CodigoInterno, NumerodeSerie, NumerodeFactura, FechadeCompra, Precio, Acargode, Estado, Caracteristicas, Depreciacion)"
            sql += "Values('" & CodigoInterno & "','" & NumerodeSerie & "','" & NumerodeFactura & "','" & FechadeCompra & "', '" & Precio & "' ,'" & Acargode & "','" & Estado & "','" & Caracteristicas & "','" & Depreciacion & "')"
            MsgBox(sql)
            cmd.CommandText = sql
            Try
                cmd.ExecuteNonQuery()
                MsgBox("Registro insertado correctamente")

            Catch ex As Exception

                If ex.ToString.Contains("duplicate") Then
                    MsgBox("El registro ya existe en la base de datos")
                Else
                    MsgBox(ex.ToString)
                End If
            End Try
        End If
    End Sub

    Private Sub DataGridView1_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvEquiposdeComputacion.CellContentClick

    End Sub

    Private Sub BtnMostrar_Click(sender As Object, e As EventArgs) Handles btnMostrar.Click
        Dim DS As New DataSet
        Dim DA As New SqlDataAdapter("Select * from [Equipos de Computacion]", conn)
        DA.Fill(DS)

        dgvEquiposdeComputacion.DataSource = DS.Tables(0)
    End Sub

    Private Sub DateTimePicker1_ValueChanged(sender As Object, e As EventArgs) Handles DateTimePicker1.ValueChanged

    End Sub

    Private Sub BtnTotalDepreciacion_Click(sender As Object, e As EventArgs) Handles btnTotalDepreciacion.Click


        NudDepreciacion.Value = CDec(FormatNumber(nudPrecio.Value * 0.25, 2))


    End Sub

    Private Sub TxtPrecio_TextChanged(sender As Object, e As EventArgs)

    End Sub

    Private Sub txtPrecio_KeyPress(sender As Object, e As KeyPressEventArgs) Handles nudPrecio.KeyPress
        nudPrecio.DecimalPlaces = 2
    End Sub

    Private Sub txtPrecio_LostFocus(sender As Object, e As EventArgs)
        Dim VarMonedaDolares As Double
        VarMonedaDolares = nudPrecio.Value

        nudPrecio.Value = CDec(FormatCurrency(VarMonedaDolares, 2))
    End Sub

End Class

AnswerRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
ZurdoDev26-Aug-19 7:38
professionalZurdoDev26-Aug-19 7:38 
AnswerRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Richard Deeming27-Aug-19 2:55
mveRichard Deeming27-Aug-19 2:55 
GeneralRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Augusto10027-Aug-19 5:36
Augusto10027-Aug-19 5:36 
GeneralRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Richard Deeming27-Aug-19 5:40
mveRichard Deeming27-Aug-19 5:40 
GeneralRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Augusto10027-Aug-19 6:23
Augusto10027-Aug-19 6:23 
GeneralRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Richard Deeming27-Aug-19 6:30
mveRichard Deeming27-Aug-19 6:30 
GeneralRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Augusto10027-Aug-19 6:36
Augusto10027-Aug-19 6:36 
GeneralRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Richard Deeming27-Aug-19 7:07
mveRichard Deeming27-Aug-19 7:07 
GeneralRe: Trying to make a fixed asset program using visual studio and sql server I got a conversion error varchar to numeric Pin
Mycroft Holmes27-Aug-19 15:14
professionalMycroft Holmes27-Aug-19 15:14 
QuestionCount the number of database hit were made Pin
desanti24-Aug-19 12:37
desanti24-Aug-19 12:37 
AnswerRe: Count the number of database hit were made Pin
Gerry Schmitz25-Aug-19 2:30
mveGerry Schmitz25-Aug-19 2:30 
GeneralRe: Count the number of database hit were made Pin
desanti25-Aug-19 3:49
desanti25-Aug-19 3:49 
GeneralRe: Count the number of database hit were made Pin
Gerry Schmitz25-Aug-19 11:38
mveGerry Schmitz25-Aug-19 11:38 
GeneralRe: Count the number of database hit were made Pin
desanti25-Aug-19 15:07
desanti25-Aug-19 15:07 
AnswerRe: Count the number of database hit were made Pin
Mycroft Holmes26-Aug-19 12:14
professionalMycroft Holmes26-Aug-19 12:14 
GeneralRe: Count the number of database hit were made Pin
desanti26-Aug-19 13:41
desanti26-Aug-19 13:41 
AnswerRe: Count the number of database hit were made Pin
Richard Deeming27-Aug-19 2:46
mveRichard Deeming27-Aug-19 2:46 

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.