Solicito analise do codigo abaixo que me passe os compelentos ?
-
sexta-feira, 13 de abril de 2012 19:51
Solicito analise do codigo abaixo que me passe os compelentos pois não tenho experiencia com esse tipo de codificação e estou usando videoe tutoriais da net e fica complicado fico grato.
Imports System.Data.SqlClient
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form2
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.Button1 = New System.Windows.Forms.Button()
Me.Button2 = New System.Windows.Forms.Button()
Me.Button3 = New System.Windows.Forms.Button()
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label5 = New System.Windows.Forms.Label()
Me.Label6 = New System.Windows.Forms.Label()
Me.Label7 = New System.Windows.Forms.Label()
Me.Label8 = New System.Windows.Forms.Label()
Me.Label9 = New System.Windows.Forms.Label()
Me.Label10 = New System.Windows.Forms.Label()
Me.Label11 = New System.Windows.Forms.Label()
Me.Label12 = New System.Windows.Forms.Label()
Me.Label13 = New System.Windows.Forms.Label()
Me.Label14 = New System.Windows.Forms.Label()
Me.Label15 = New System.Windows.Forms.Label()
Me.Label16 = New System.Windows.Forms.Label()
Me.Label17 = New System.Windows.Forms.Label()
Me.Label18 = New System.Windows.Forms.Label()
Me.Label19 = New System.Windows.Forms.Label()
Me.Label20 = New System.Windows.Forms.Label()
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.TextBox2 = New System.Windows.Forms.TextBox()
Me.TextBox3 = New System.Windows.Forms.TextBox()
Me.TextBox4 = New System.Windows.Forms.TextBox()
Me.TextBox5 = New System.Windows.Forms.TextBox()
Me.TextBox6 = New System.Windows.Forms.TextBox()
Me.TextBox7 = New System.Windows.Forms.TextBox()
Me.TextBox8 = New System.Windows.Forms.TextBox()
Me.TextBox9 = New System.Windows.Forms.TextBox()
Me.TextBox10 = New System.Windows.Forms.TextBox()
Me.TextBox11 = New System.Windows.Forms.TextBox()
Me.TextBox12 = New System.Windows.Forms.TextBox()
Me.TextBox13 = New System.Windows.Forms.TextBox()
Me.TextBox14 = New System.Windows.Forms.TextBox()
Me.TextBox15 = New System.Windows.Forms.TextBox()
Me.TextBox16 = New System.Windows.Forms.TextBox()
Me.TextBox17 = New System.Windows.Forms.TextBox()
Me.TextBox18 = New System.Windows.Forms.TextBox()
Me.TextBox19 = New System.Windows.Forms.TextBox()
Me.SuspendLayout()
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(92, 493)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(114, 49)
Me.Button1.TabIndex = 0
Me.Button1.Text = "Inserir Dados"
Me.Button1.UseVisualStyleBackColor = True
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(234, 493)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(122, 48)
Me.Button2.TabIndex = 1
Me.Button2.Text = "Alterar Dados"
Me.Button2.UseVisualStyleBackColor = True
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(380, 493)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(134, 49)
Me.Button3.TabIndex = 2
Me.Button3.Text = "Apagar Dados"
Me.Button3.UseVisualStyleBackColor = True
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(16, 34)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(38, 13)
Me.Label1.TabIndex = 3
Me.Label1.Text = "Nome:"
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(426, 34)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(45, 13)
Me.Label2.TabIndex = 4
Me.Label2.Text = "Apelido:"
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(16, 72)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(38, 13)
Me.Label3.TabIndex = 5
Me.Label3.Text = "E-mail:"
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(426, 72)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(46, 13)
Me.Label4.TabIndex = 6
Me.Label4.Text = "Função:"
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Location = New System.Drawing.Point(16, 116)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(56, 13)
Me.Label5.TabIndex = 7
Me.Label5.Text = "Endereço:"
'
'Label6
'
Me.Label6.AutoSize = True
Me.Label6.Location = New System.Drawing.Point(426, 116)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(19, 13)
Me.Label6.TabIndex = 8
Me.Label6.Text = "Nº"
'
'Label7
'
Me.Label7.AutoSize = True
Me.Label7.Location = New System.Drawing.Point(16, 156)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(37, 13)
Me.Label7.TabIndex = 9
Me.Label7.Text = "Bairro:"
'
'Label8
'
Me.Label8.AutoSize = True
Me.Label8.Location = New System.Drawing.Point(183, 156)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(29, 13)
Me.Label8.TabIndex = 10
Me.Label8.Text = "Cep."
'
'Label9
'
Me.Label9.AutoSize = True
Me.Label9.Location = New System.Drawing.Point(344, 156)
Me.Label9.Name = "Label9"
Me.Label9.Size = New System.Drawing.Size(74, 13)
Me.Label9.TabIndex = 11
Me.Label9.Text = "Telefone Res:"
'
'Label10
'
Me.Label10.AutoSize = True
Me.Label10.Location = New System.Drawing.Point(16, 195)
Me.Label10.Name = "Label10"
Me.Label10.Size = New System.Drawing.Size(101, 13)
Me.Label10.TabIndex = 12
Me.Label10.Text = "Telefone Comercial:"
'
'Label11
'
Me.Label11.AutoSize = True
Me.Label11.Location = New System.Drawing.Point(264, 195)
Me.Label11.Name = "Label11"
Me.Label11.Size = New System.Drawing.Size(42, 13)
Me.Label11.TabIndex = 13
Me.Label11.Text = "Celular:"
'
'Label12
'
Me.Label12.AutoSize = True
Me.Label12.Location = New System.Drawing.Point(16, 231)
Me.Label12.Name = "Label12"
Me.Label12.Size = New System.Drawing.Size(107, 13)
Me.Label12.TabIndex = 14
Me.Label12.Text = "Data de Nascimento:"
'
'Label13
'
Me.Label13.AutoSize = True
Me.Label13.Location = New System.Drawing.Point(264, 231)
Me.Label13.Name = "Label13"
Me.Label13.Size = New System.Drawing.Size(40, 13)
Me.Label13.TabIndex = 15
Me.Label13.Text = "Partido"
'
'Label14
'
Me.Label14.AutoSize = True
Me.Label14.Location = New System.Drawing.Point(373, 231)
Me.Label14.Name = "Label14"
Me.Label14.Size = New System.Drawing.Size(69, 13)
Me.Label14.TabIndex = 16
Me.Label14.Text = "Indicado por:"
'
'Label15
'
Me.Label15.AutoSize = True
Me.Label15.Location = New System.Drawing.Point(16, 267)
Me.Label15.Name = "Label15"
Me.Label15.Size = New System.Drawing.Size(100, 13)
Me.Label15.TabIndex = 17
Me.Label15.Text = "Bairros de Atuação:"
'
'Label16
'
Me.Label16.AutoSize = True
Me.Label16.Location = New System.Drawing.Point(16, 300)
Me.Label16.Name = "Label16"
Me.Label16.Size = New System.Drawing.Size(129, 13)
Me.Label16.TabIndex = 18
Me.Label16.Text = "Seguimentos de Atuação:"
'
'Label17
'
Me.Label17.AutoSize = True
Me.Label17.Location = New System.Drawing.Point(16, 332)
Me.Label17.Name = "Label17"
Me.Label17.Size = New System.Drawing.Size(48, 13)
Me.Label17.TabIndex = 19
Me.Label17.Text = "Religião:"
'
'Label18
'
Me.Label18.AutoSize = True
Me.Label18.Location = New System.Drawing.Point(264, 332)
Me.Label18.Name = "Label18"
Me.Label18.Size = New System.Drawing.Size(59, 13)
Me.Label18.TabIndex = 20
Me.Label18.Text = "Solicitação"
'
'Label19
'
Me.Label19.AutoSize = True
Me.Label19.Location = New System.Drawing.Point(344, 359)
Me.Label19.Name = "Label19"
Me.Label19.Size = New System.Drawing.Size(57, 13)
Me.Label19.TabIndex = 21
Me.Label19.Text = "Atendidas:"
'
'Label20
'
Me.Label20.AutoSize = True
Me.Label20.Location = New System.Drawing.Point(344, 394)
Me.Label20.Name = "Label20"
Me.Label20.Size = New System.Drawing.Size(80, 13)
Me.Label20.TabIndex = 22
Me.Label20.Text = "Não Atendidas:"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(60, 31)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(358, 20)
Me.TextBox1.TabIndex = 23
'
'TextBox2
'
Me.TextBox2.Location = New System.Drawing.Point(477, 31)
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.Size = New System.Drawing.Size(100, 20)
Me.TextBox2.TabIndex = 24
'
'TextBox3
'
Me.TextBox3.Location = New System.Drawing.Point(60, 69)
Me.TextBox3.Name = "TextBox3"
Me.TextBox3.Size = New System.Drawing.Size(358, 20)
Me.TextBox3.TabIndex = 25
'
'TextBox4
'
Me.TextBox4.Location = New System.Drawing.Point(478, 65)
Me.TextBox4.Name = "TextBox4"
Me.TextBox4.Size = New System.Drawing.Size(100, 20)
Me.TextBox4.TabIndex = 26
'
'TextBox5
'
Me.TextBox5.Location = New System.Drawing.Point(78, 113)
Me.TextBox5.Name = "TextBox5"
Me.TextBox5.Size = New System.Drawing.Size(340, 20)
Me.TextBox5.TabIndex = 27
'
'TextBox6
'
Me.TextBox6.Location = New System.Drawing.Point(451, 116)
Me.TextBox6.Name = "TextBox6"
Me.TextBox6.Size = New System.Drawing.Size(126, 20)
Me.TextBox6.TabIndex = 28
'
'TextBox7
'
Me.TextBox7.Location = New System.Drawing.Point(424, 153)
Me.TextBox7.Name = "TextBox7"
Me.TextBox7.Size = New System.Drawing.Size(146, 20)
Me.TextBox7.TabIndex = 29
'
'TextBox8
'
Me.TextBox8.Location = New System.Drawing.Point(59, 153)
Me.TextBox8.Name = "TextBox8"
Me.TextBox8.Size = New System.Drawing.Size(118, 20)
Me.TextBox8.TabIndex = 30
'
'TextBox9
'
Me.TextBox9.Location = New System.Drawing.Point(218, 153)
Me.TextBox9.Name = "TextBox9"
Me.TextBox9.Size = New System.Drawing.Size(120, 20)
Me.TextBox9.TabIndex = 31
'
'TextBox10
'
Me.TextBox10.Location = New System.Drawing.Point(123, 192)
Me.TextBox10.Name = "TextBox10"
Me.TextBox10.Size = New System.Drawing.Size(141, 20)
Me.TextBox10.TabIndex = 32
'
'TextBox11
'
Me.TextBox11.Location = New System.Drawing.Point(311, 192)
Me.TextBox11.Name = "TextBox11"
Me.TextBox11.Size = New System.Drawing.Size(173, 20)
Me.TextBox11.TabIndex = 33
'
'TextBox12
'
Me.TextBox12.Location = New System.Drawing.Point(129, 228)
Me.TextBox12.Name = "TextBox12"
Me.TextBox12.Size = New System.Drawing.Size(129, 20)
Me.TextBox12.TabIndex = 34
'
'TextBox13
'
Me.TextBox13.Location = New System.Drawing.Point(301, 228)
Me.TextBox13.Name = "TextBox13"
Me.TextBox13.Size = New System.Drawing.Size(74, 20)
Me.TextBox13.TabIndex = 35
'
'TextBox14
'
Me.TextBox14.Location = New System.Drawing.Point(448, 228)
Me.TextBox14.Name = "TextBox14"
Me.TextBox14.Size = New System.Drawing.Size(122, 20)
Me.TextBox14.TabIndex = 36
'
'TextBox15
'
Me.TextBox15.Location = New System.Drawing.Point(122, 264)
Me.TextBox15.Name = "TextBox15"
Me.TextBox15.Size = New System.Drawing.Size(427, 20)
Me.TextBox15.TabIndex = 37
'
'TextBox16
'
Me.TextBox16.Location = New System.Drawing.Point(151, 297)
Me.TextBox16.Name = "TextBox16"
Me.TextBox16.Size = New System.Drawing.Size(398, 20)
Me.TextBox16.TabIndex = 38
'
'TextBox17
'
Me.TextBox17.Location = New System.Drawing.Point(70, 329)
Me.TextBox17.Name = "TextBox17"
Me.TextBox17.Size = New System.Drawing.Size(177, 20)
Me.TextBox17.TabIndex = 39
'
'TextBox18
'
Me.TextBox18.Location = New System.Drawing.Point(430, 391)
Me.TextBox18.Name = "TextBox18"
Me.TextBox18.Size = New System.Drawing.Size(100, 20)
Me.TextBox18.TabIndex = 40
'
'TextBox19
'
Me.TextBox19.Location = New System.Drawing.Point(430, 356)
Me.TextBox19.Name = "TextBox19"
Me.TextBox19.Size = New System.Drawing.Size(100, 20)
Me.TextBox19.TabIndex = 41
'
'Form2
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(601, 569)
Me.Controls.Add(Me.TextBox19)
Me.Controls.Add(Me.TextBox18)
Me.Controls.Add(Me.TextBox17)
Me.Controls.Add(Me.TextBox16)
Me.Controls.Add(Me.TextBox15)
Me.Controls.Add(Me.TextBox14)
Me.Controls.Add(Me.TextBox13)
Me.Controls.Add(Me.TextBox12)
Me.Controls.Add(Me.TextBox11)
Me.Controls.Add(Me.TextBox10)
Me.Controls.Add(Me.TextBox9)
Me.Controls.Add(Me.TextBox8)
Me.Controls.Add(Me.TextBox7)
Me.Controls.Add(Me.TextBox6)
Me.Controls.Add(Me.TextBox5)
Me.Controls.Add(Me.TextBox4)
Me.Controls.Add(Me.TextBox3)
Me.Controls.Add(Me.TextBox2)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.Label20)
Me.Controls.Add(Me.Label19)
Me.Controls.Add(Me.Label18)
Me.Controls.Add(Me.Label17)
Me.Controls.Add(Me.Label16)
Me.Controls.Add(Me.Label15)
Me.Controls.Add(Me.Label14)
Me.Controls.Add(Me.Label13)
Me.Controls.Add(Me.Label12)
Me.Controls.Add(Me.Label11)
Me.Controls.Add(Me.Label10)
Me.Controls.Add(Me.Label9)
Me.Controls.Add(Me.Label8)
Me.Controls.Add(Me.Label7)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.Name = "Form2"
Me.Text = "Mapealento de Lideranças"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents Label7 As System.Windows.Forms.Label
Friend WithEvents Label8 As System.Windows.Forms.Label
Friend WithEvents Label9 As System.Windows.Forms.Label
Friend WithEvents Label10 As System.Windows.Forms.Label
Friend WithEvents Label11 As System.Windows.Forms.Label
Friend WithEvents Label12 As System.Windows.Forms.Label
Friend WithEvents Label13 As System.Windows.Forms.Label
Friend WithEvents Label14 As System.Windows.Forms.Label
Friend WithEvents Label15 As System.Windows.Forms.Label
Friend WithEvents Label16 As System.Windows.Forms.Label
Friend WithEvents Label17 As System.Windows.Forms.Label
Friend WithEvents Label18 As System.Windows.Forms.Label
Friend WithEvents Label19 As System.Windows.Forms.Label
Friend WithEvents Label20 As System.Windows.Forms.Label
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
Friend WithEvents TextBox4 As System.Windows.Forms.TextBox
Friend WithEvents TextBox5 As System.Windows.Forms.TextBox
Friend WithEvents TextBox6 As System.Windows.Forms.TextBox
Friend WithEvents TextBox7 As System.Windows.Forms.TextBox
Friend WithEvents TextBox8 As System.Windows.Forms.TextBox
Friend WithEvents TextBox9 As System.Windows.Forms.TextBox
Friend WithEvents TextBox10 As System.Windows.Forms.TextBox
Friend WithEvents TextBox11 As System.Windows.Forms.TextBox
Friend WithEvents TextBox12 As System.Windows.Forms.TextBox
Friend WithEvents TextBox13 As System.Windows.Forms.TextBox
Friend WithEvents TextBox14 As System.Windows.Forms.TextBox
Friend WithEvents TextBox15 As System.Windows.Forms.TextBox
Friend WithEvents TextBox16 As System.Windows.Forms.TextBox
Friend WithEvents TextBox17 As System.Windows.Forms.TextBox
Friend WithEvents TextBox18 As System.Windows.Forms.TextBox
Friend WithEvents TextBox19 As System.Windows.Forms.TextBox
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
String conexao = "Data source=localhost; User id=root; Password; Intial Catalog=cadastro eleitoal";
SqlConnection(con = New SqlConnection(conexao);
String sql = "Isert Into Liderança() Values()";
MySqlCommand cmd = New MySqlCommand(sql,con);
Cmd.Parameters.AddWithValue("");
Con.open();
cmd.ExecuteNonQuery();
End Sub
End Class
Todas as Respostas
-
sexta-feira, 13 de abril de 2012 20:10Vc n deveria ter postado no forum de vb isso n?
Att. Lucas Rodrigues
-
sexta-feira, 13 de abril de 2012 20:35Qual a dúvida? Vejo vários erros.
-
sábado, 14 de abril de 2012 02:51
então a minha duvida é exatamente essa como posso corrigir esse erros que vc esta vendo pois gostaria de conectar o botão de inserir ou gravar dados em uma tabela do mysql sendo isso online dentro de um sevidor.
-
sábado, 14 de abril de 2012 02:52toda ajuda é bewm vinda muito obrigado por palavras tão futeis.
-
sábado, 14 de abril de 2012 11:18
Bom dia
Isso deve ser VisualBasic, você deve postar isso num forum de VisualBasic, mas veja estas linhas que você postou
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.Traduzindo ficaria assim
"NOTA: O procedimento a seguir é exigido pelo Windows Form Designer
"Ele pode ser modificado usando o Windows Form Designer.
'Não modifique-o usando o editor de código.Você não deve edita no Form.Designer.cs. Esse codigo é gerado automaticamente e cada componente que voce adiciona ou remove d Form. -
sábado, 14 de abril de 2012 17:33Moderador
Apenas uma pergunta?
Estas a usar DLL do visual basic dentro do C#?
Estive a ler o teu post, parece que o casamento entre o VB e C# esta mal realizado. Vai dar conflito.
Estas a escrever no formato vb dentro no c#. No c# nao se usa Me. Mais sim this.
A condicao If nao leva then no C#.
Tu podes usar DLL no VB dentro do C# mais nao podes escrever os codigos no formato do VB, como fizeste. Primeiro vais ter de divorciar este codigo - elimina tudo Me, then, andalso, depois tenta usar simplesmente c#.
One word frees us of all the weight and pain of life: that word is love.
- Marcado como Resposta Harley AraujoOwner segunda-feira, 16 de abril de 2012 11:29

