Jump to content

[RESOLVIDO][vb2005] insert um novo registo


esquima

Recommended Posts

pessoal, tou a tentar inserir um novo registo na bd. o select corre bem o update tb, mas o insert nao...da me erro de sintaxe na instrução SELECT INTO

é estranho pq ta tudo correcto

  

Dim sSql As String
        Dim oDR As OleDbDataReader

        'sSql = " SELECT pass From usernet WHERE user = '" & TextUser.Text & "'"
        sSql = "INSERT INTO usernet (user,pass) VALUES ('" & TextUser.Text & "','" & TextPass1.Text & "')"
        'sSql = "UPDATE  usernet Set pass =('" & TextPass1.Text & "') where user='" & TextUser.Text & "'"
        Dim ex As Exception
        Try

            oDR = abreConexao(sSql)
            oDR.Close()
            MsgBox("Novo Registo Web inserido com sucesso", MsgBoxStyle.Information)
        Catch ex
            MsgBox(ex.Message)
        End Try
    End Sub

Link to comment
Share on other sites

for (int i = 0; i < GridView1.Rows.Count; i++)
        {


        CheckBox cb = (CheckBox)GridView1.Rows[i].Cells[0].FindControl("CheckBox1");//Gets the checkbox id in the grid. I assume that your checkbox is in the first column in your grid
        
        if (cb.Checked == true)
        {
            //Do something here when CheckBox = True
        }
        else
        { //Do something here when CheckBox = False}
            }
        } 



Link to comment
Share on other sites

Boas

Isso não c é c# tenta converter usando a seguinte ferramenta http://labs.developerfusion.co.uk/convert/csharp-to-vb.aspx

"The Dark Side Clouds Everthing. Impossible To See The Future Is."My rig: Intel Core 2 Quad Q9450 | abit IP35P | 4G Kingston 800 Mhz | XFX GeForce 9800 GX2 1G ddr3 | 2X WD5000AAJS 500Gb Sata 2 | PSU 600W || Caixa El-Diablo | Creative XMod

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.