Click here to Skip to main content
15,887,398 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Activate a Textbox in a other Program Pin
Dave Herren26-May-07 3:14
Dave Herren26-May-07 3:14 
QuestionHow can I have my program link to MyApp.msi on my website? Pin
furjaw21-May-07 7:44
furjaw21-May-07 7:44 
AnswerRe: How can I have my program link to MyApp.msi on my website? Pin
Dave Kreskowiak21-May-07 16:08
mveDave Kreskowiak21-May-07 16:08 
GeneralRe: How can I have my program link to MyApp.msi on my website? Pin
furjaw21-May-07 19:29
furjaw21-May-07 19:29 
GeneralRe: How can I have my program link to MyApp.msi on my website? Pin
Dave Kreskowiak22-May-07 11:59
mveDave Kreskowiak22-May-07 11:59 
QuestionPersistant DataSet data entry problem Pin
Quecumber25621-May-07 5:41
Quecumber25621-May-07 5:41 
AnswerRe: Persistant DataSet data entry problem Pin
Marcus J. Smith21-May-07 6:17
professionalMarcus J. Smith21-May-07 6:17 
GeneralRe: Persistant DataSet data entry problem Pin
Quecumber25621-May-07 7:06
Quecumber25621-May-07 7:06 
Cleako:
Just to let you know I appreciate your help.

I tried your fix. I still get the same results. Therefore I'm providing you the entire code for the data entry form. I hope this give you enough information to see what is causing the first record to not be recorded properly.

Option Explicit On
Imports System.Data.SqlClient

Public Class frmBindings
Private Msg As String
Private strSQL As String
'Declare the SQLDataAdapter and DataSet objects
Private daBindings As New SqlDataAdapter()
Private MyDataSet As New DataSet()
Dim tblBindings As DataTable
Dim drCurrent As DataRow

Private Sub Clear_Form()
txtBindingCode.Text = Nothing
txtBindingName.Text = Nothing
txtOrdinal.Text = Nothing
End Sub

Private Sub Load_DataSet()
'Connect to the SQL Server database
Dim cn As SqlConnection = New SqlConnection((My.Settings.PrintsByMe_DevConnectionString))
cn.Open()
'Retrieve the data using a SQL statement
strSQL = "SELECT * FROM [tblBindings];"
Dim cd As New SqlCommand(strSQL, cn)
'Set the database connection for MySqlDataAdapter
daBindings.SelectCommand = cd
'Fill the DataSet and DataSet Schema
daBindings.FillSchema(MyDataSet, SchemaType.Source, "tblBindings")
daBindings.Fill(MyDataSet, "tblBindings")
'Close database connection
cn.Close()
'Set the BindingNavigator's DataSource to the DataSet we created.
bsBindings.DataSource = MyDataSet
'Set the BindingSource Datamember to the table we are using.
bsBindings.DataMember = MyDataSet.Tables(0).TableName()
'Bind form control txtBindingID to the BindingID field
txtBindingID.DataBindings.Add("Text", bsBindings, "BindingID")
'Bind form control txtOrdinal to the Ordinal field
txtOrdinal.DataBindings.Add("Text", bsBindings, "Ordinal")
'Bind form control txtBindingCode to the BindingCode field
txtBindingCode.DataBindings.Add("Text", bsBindings, "BindingCode")
'Bind form control txtBindingName to the BindingName Field
txtBindingName.DataBindings.Add("Text", bsBindings, "BindingName")
End Sub

Private Sub New_Bindings(ByVal intOrdinal As Integer, _
ByVal strCode As String, _
ByVal strName As String)

drCurrent = MyDataSet.Tables("tblBindings").NewRow()
drCurrent("Ordinal") = intOrdinal
drCurrent("BindingCode") = strCode
drCurrent("BindingName") = strName
MyDataSet.Tables("tblBindings").Rows.Add(drCurrent)
'Call Clear_Form()
End Sub

Private Sub btnClose_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles btnExit.Click
Me.Close()
End Sub

Private Sub frmBindings_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load

Call Load_DataSet()
naviBindings.BindingSource = bsBindings
End Sub


Private Sub BindingNavigatorAddNewItem_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles BindingNavigatorAddNewItem.Click
'Call New_Bindings(CInt(txtOrdinal.Text), txtBindingCode.Text, txtBindingName.Text)
Call New_Bindings(1, "SDLS", "Saddle-stitch")
Call New_Bindings(2, "SPRL", "Spiral Bound")
Call New_Bindings(3, "STUL", "Staple Upper Left")
Call New_Bindings(4, "STUR", "Staple Upper Right")
Call New_Bindings(5, "ST2L", "Two Staples on left side")
End Sub
End Class

Thanks again,

Quecumber256
GeneralRe: Persistant DataSet data entry problem Pin
Marcus J. Smith21-May-07 7:35
professionalMarcus J. Smith21-May-07 7:35 
GeneralRe: Persistant DataSet data entry problem Pin
Quecumber25621-May-07 8:08
Quecumber25621-May-07 8:08 
GeneralRe: Persistant DataSet data entry problem Pin
Marcus J. Smith21-May-07 8:28
professionalMarcus J. Smith21-May-07 8:28 
GeneralRe: Persistant DataSet data entry problem Pin
Quecumber25621-May-07 9:21
Quecumber25621-May-07 9:21 
QuestionDeath by obfuscation! Pin
Rich Leyshon21-May-07 5:28
Rich Leyshon21-May-07 5:28 
AnswerRe: Death by obfuscation! Pin
sthotakura21-May-07 11:02
sthotakura21-May-07 11:02 
GeneralRe: Death by obfuscation! Pin
Rich Leyshon21-May-07 11:10
Rich Leyshon21-May-07 11:10 
QuestionSQL UPDATE Stored Procedure in VB Not Working Pin
tommyfs21-May-07 4:44
tommyfs21-May-07 4:44 
AnswerRe: SQL UPDATE Stored Procedure in VB Not Working Pin
Dave Herren21-May-07 5:36
Dave Herren21-May-07 5:36 
AnswerRe: SQL UPDATE Stored Procedure in VB Not Working Pin
tommyfs24-May-07 13:18
tommyfs24-May-07 13:18 
Questionhow to find out rowindex in datagrid's drop-event? Pin
Smithers-Jones21-May-07 4:08
Smithers-Jones21-May-07 4:08 
AnswerRe: how to find out rowindex in datagrid's drop-event? Pin
Smithers-Jones21-May-07 21:58
Smithers-Jones21-May-07 21:58 
QuestionDate Format question Pin
No-e21-May-07 3:42
No-e21-May-07 3:42 
AnswerRe: Date Format question Pin
No-e21-May-07 4:02
No-e21-May-07 4:02 
Questionwats wrong in this Pin
balakpn21-May-07 3:42
balakpn21-May-07 3:42 
AnswerRe: wats wrong in this Pin
Dave Kreskowiak21-May-07 4:21
mveDave Kreskowiak21-May-07 4:21 
GeneralRe: wats wrong in this Pin
balakpn22-May-07 1:43
balakpn22-May-07 1:43 

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.