Click here to Skip to main content
15,918,268 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionupdating database through datagrid - HELP PLEASE! Pin
libbypop23-Oct-08 17:44
libbypop23-Oct-08 17:44 
AnswerRe: updating database through datagrid - HELP PLEASE! Pin
Johan Hakkesteegt24-Oct-08 0:41
Johan Hakkesteegt24-Oct-08 0:41 
QuestionData validation in a textbox Pin
saypokguy23-Oct-08 14:03
saypokguy23-Oct-08 14:03 
AnswerRe: Data validation in a textbox Pin
Rupesh Kumar Swami23-Oct-08 20:50
Rupesh Kumar Swami23-Oct-08 20:50 
AnswerRe: Data validation in a textbox Pin
Wendelius24-Oct-08 8:20
mentorWendelius24-Oct-08 8:20 
Questiontextbox Pin
kewyn23-Oct-08 8:58
kewyn23-Oct-08 8:58 
AnswerRe: textbox Pin
Dave Kreskowiak23-Oct-08 9:06
mveDave Kreskowiak23-Oct-08 9:06 
GeneralRe: textbox Pin
kewyn23-Oct-08 9:19
kewyn23-Oct-08 9:19 
hi

sorry if i sounded that way, i am just tired of this not working

Public Class form1
Inherits System.Windows.Forms.Form
Dim Reader As SqlClient.SqlDataReader
#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
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.
Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid
Friend WithEvents SqlCon As System.Data.SqlClient.SqlConnection Friend WithEvents SqlDataAdapter1 As System.Data.SqlClient.SqlDataAdapter
Friend WithEvents SqlSelectCommand1 As System.Data.SqlClient.SqlCommand
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents DataSet2 As logintrial.DataSet2
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.DataGrid1 = New System.Windows.Forms.DataGrid
Me.SqlCon = New System.Data.SqlClient.SqlConnection
Me.SqlDataAdapter1 = New System.Data.SqlClient.SqlDataAdapter
Me.SqlSelectCommand1 = New System.Data.SqlClient.SqlCommand
Me.Button1 = New System.Windows.Forms.Button
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.TextBox2 = New System.Windows.Forms.TextBox
Me.DataSet2 = New logintrial.DataSet2
CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.DataSet2, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'DataGrid1
'
Me.DataGrid1.DataMember = ""
Me.DataGrid1.DataSource = Me.DataSet2.CASHIER_INFO
Me.DataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.DataGrid1.Location = New System.Drawing.Point(48, 112)
Me.DataGrid1.Name = "DataGrid1"
Me.DataGrid1.Size = New System.Drawing.Size(296, 96)
Me.DataGrid1.TabIndex = 0
'
'SqlCon
'
Me.SqlCon.ConnectionString = "workstation id=KEWYN;packet size=4096;integrated security=SSPI;data source=KEWYN;" & _
"persist security info=False;initial catalog=343344"

'SqlDataAdapter1
'
Me.SqlDataAdapter1.SelectCommand = Me.SqlSelectCommand1
Me.SqlDataAdapter1.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "CASHIER_INFO", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("CashierId", "CashierId"), New System.Data.Common.DataColumnMapping("Cashier_Firstname", "Cashier_Firstname"), New System.Data.Common.DataColumnMapping("Cashier_Lastname", "Cashier_Lastname")})})
'
'SqlSelectCommand1
'
Me.SqlSelectCommand1.CommandText = "SELECT CashierId, Cashier_Firstname, Cashier_Lastname FROM CASHIER_INFO"
Me.SqlSelectCommand1.Connection = Me.SqlCon
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(232, 192)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(56, 56)
Me.Button1.TabIndex = 1
Me.Button1.Text = "Button1"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(96, 24)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(104, 20)
Me.TextBox1.TabIndex = 2
Me.TextBox1.Text = ""
'
'TextBox2
'
Me.TextBox2.Location = New System.Drawing.Point(96, 56)
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.Size = New System.Drawing.Size(160, 20)
Me.TextBox2.TabIndex = 3
Me.TextBox2.Text = ""
'
'DataSet2
'
Me.DataSet2.DataSetName = "DataSet2"
Me.DataSet2.Locale = New System.Globalization.CultureInfo("en-US")
'
'form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(368, 266)
Me.Controls.Add(Me.TextBox2)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.DataGrid1)
Me.Name = "form1"
Me.Text = "login"
CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.DataSet2, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)

End Sub

#End Region
Dim key As BindingManagerBase
Private Sub form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.SqlDataAdapter1().Fill(Me.DataSet2) 'fill the data adapter with the dataset





Me.TextBox1().Text() = ""
Me.TextBox1().PasswordChar() = "*"


key = Me.BindingContext(DataSet2, "cashier_info")

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

'If (Me.TextBox1.TabIndex <> -1 Or Me.CompanyComboBox.SelectedIndex <> Nothing) Then
Try
'Dim index As Integer = Me.CompanyComboBox.SelectedIndex
Dim dr As DataSet2.CASHIER_INFORow


'If Reader.Read() Then

'Me.TextBox2().Text() = Me.TextBox1.Text
Me.TextBox2().Text() = String.Format("{0}{1}", dr.CashierId)


'End If
Catch

MessageBox.Show("DID NOT WORK")

Me.Close()

End Try

End Sub
End Class
GeneralRe: textbox Pin
Dave Kreskowiak23-Oct-08 10:44
mveDave Kreskowiak23-Oct-08 10:44 
GeneralRe: textbox Pin
Guffa23-Oct-08 13:58
Guffa23-Oct-08 13:58 
QuestionHow do you get the rectangular coordinates for Bookmarks in Word 2000 / 2003 ? Pin
Tomb42123-Oct-08 8:09
Tomb42123-Oct-08 8:09 
Questiontext box Pin
kewyn23-Oct-08 7:55
kewyn23-Oct-08 7:55 
AnswerRe: text box Pin
Dave Kreskowiak23-Oct-08 8:24
mveDave Kreskowiak23-Oct-08 8:24 
QuestionNeed Despriate Help with LPR printing Pin
Trey549823-Oct-08 7:47
Trey549823-Oct-08 7:47 
AnswerRe: Need Despriate Help with LPR printing Pin
Dave Kreskowiak23-Oct-08 9:03
mveDave Kreskowiak23-Oct-08 9:03 
GeneralRe: Need Despriate Help with LPR printing Pin
Trey549823-Oct-08 9:26
Trey549823-Oct-08 9:26 
QuestionInsert graphic image into PDF Pin
Cory Kimble23-Oct-08 6:34
Cory Kimble23-Oct-08 6:34 
AnswerRe: Insert graphic image into PDF Pin
Dave Kreskowiak23-Oct-08 7:37
mveDave Kreskowiak23-Oct-08 7:37 
QuestionProcess.Start Pin
KreativeKai23-Oct-08 6:30
professionalKreativeKai23-Oct-08 6:30 
AnswerRe: Process.Start Pin
Jon_Boy23-Oct-08 6:39
Jon_Boy23-Oct-08 6:39 
GeneralRe: Process.Start Pin
Jon_Boy23-Oct-08 8:27
Jon_Boy23-Oct-08 8:27 
AnswerRe: Process.Start Pin
Dave Kreskowiak23-Oct-08 7:35
mveDave Kreskowiak23-Oct-08 7:35 
GeneralRe: Process.Start Pin
KreativeKai23-Oct-08 7:50
professionalKreativeKai23-Oct-08 7:50 
GeneralRe: Process.Start Pin
Dave Kreskowiak23-Oct-08 8:02
mveDave Kreskowiak23-Oct-08 8:02 
GeneralRe: Process.Start Pin
KreativeKai23-Oct-08 8:14
professionalKreativeKai23-Oct-08 8: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.