Click here to Skip to main content
15,881,852 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Chat Application Pin
leckey18-May-07 8:01
leckey18-May-07 8:01 
GeneralRe: Chat Application Pin
Paul Conrad18-May-07 10:18
professionalPaul Conrad18-May-07 10:18 
GeneralRe: Chat Application Pin
The ANZAC18-May-07 12:10
The ANZAC18-May-07 12:10 
GeneralRe: Chat Application Pin
Paul Conrad18-May-07 14:42
professionalPaul Conrad18-May-07 14:42 
GeneralRe: Read what i asked? Pin
kantipudi21-May-07 19:48
kantipudi21-May-07 19:48 
QuestionHelp me make this code to Point to SQl Server that Access localy Pin
Vimalsoft(Pty) Ltd18-May-07 3:39
professionalVimalsoft(Pty) Ltd18-May-07 3:39 
AnswerRe: Help me make this code to Point to SQl Server that Access localy Pin
Dave Kreskowiak18-May-07 4:20
mveDave Kreskowiak18-May-07 4:20 
QuestionProblems add a new record to a DataSet using the BindingNavigator Control Pin
Quecumber25618-May-07 3:11
Quecumber25618-May-07 3:11 
Hi Everyone:
I have solved the problem of how to bind a DataSet to the BindingNavigator control thanks to those who guided me in the right direction.

I now have another problem that is causing me ulcers.

When I populate the DataSet with data I retrieved from some table. I have no trouble using the move next, move previous, move first and move last buttons on the BindingNavigator control. I can navigate from record to record with no problem.

When I try to add a new record into the dataset using the routine written below; two problems occur. 1 – The auto increment ID number goes from 5(the last record ID in the Dataset) to 7. What happened to 6? 2 – After I add the new record’s data; when I page back through the dataset’s records the new record I just added has the record ID of 7. When I move to the previous record 6 (the one that was skipped) I see the data for the first record in the dataset. Records 5 to 2 seem to be correct, but record 1 is empty.

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

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

Logic dictates when I add a new record to the dataset it is added at the end of the dataset. This doesn’t seem to be happening. What I plan on doing is after I update the Dataset I will use the DataAdapter to write the changes back to the SQL Sever database, but the dataset looks incorrect, so I won’t commit an update until I’m sure the dataset’s information is correct.

A corollary to this problem is when I try to add records to an empty dataset. I get the DBNull error.

Does anyone know how to add a new record to: 1) an existing dataset, or 2) an empty one?

Thanks,


Quecumber256
AnswerRe: Problems add a new record to a DataSet using the BindingNavigator Control Pin
Marcus J. Smith18-May-07 4:36
professionalMarcus J. Smith18-May-07 4:36 
GeneralRe: Problems add a new record to a DataSet using the BindingNavigator Control Pin
Quecumber25618-May-07 5:13
Quecumber25618-May-07 5:13 
GeneralRe: Problems add a new record to a DataSet using the BindingNavigator Control Pin
Marcus J. Smith18-May-07 5:32
professionalMarcus J. Smith18-May-07 5:32 
GeneralRe: Problems add a new record to a DataSet using the BindingNavigator Control Pin
Quecumber25618-May-07 6:22
Quecumber25618-May-07 6:22 
GeneralRe: Problems add a new record to a DataSet using the BindingNavigator Control Pin
Marcus J. Smith18-May-07 7:20
professionalMarcus J. Smith18-May-07 7:20 
GeneralRe: Problems add a new record to a DataSet using the BindingNavigator Control Pin
Quecumber25618-May-07 7:34
Quecumber25618-May-07 7:34 
GeneralRe: Problems add a new record to a DataSet using the BindingNavigator Control Pin
Marcus J. Smith18-May-07 8:10
professionalMarcus J. Smith18-May-07 8:10 
GeneralRe: Problems add a new record to a DataSet using the BindingNavigator Control Pin
Quecumber25618-May-07 8:47
Quecumber25618-May-07 8:47 
GeneralRe: Problems add a new record to a DataSet using the BindingNavigator Control Pin
Marcus J. Smith18-May-07 9:53
professionalMarcus J. Smith18-May-07 9:53 
GeneralRe: Problems add a new record to a DataSet using the BindingNavigator Control Pin
Quecumber25618-May-07 10:14
Quecumber25618-May-07 10:14 
Questioncreating stles for windows form controls Pin
MartyK200718-May-07 2:26
MartyK200718-May-07 2:26 
AnswerRe: creating stles for windows form controls Pin
Christian Graus18-May-07 3:04
protectorChristian Graus18-May-07 3:04 
GeneralRe: creating stles for windows form controls Pin
MartyK200718-May-07 3:06
MartyK200718-May-07 3:06 
QuestionHow to paste to the default mail client Pin
triley125818-May-07 1:08
triley125818-May-07 1:08 
AnswerRe: How to paste to the default mail client Pin
Xandip18-May-07 1:58
Xandip18-May-07 1:58 
GeneralRe: How to paste to the default mail client Pin
triley125818-May-07 3:43
triley125818-May-07 3:43 
Questionthreads Problem Pin
psiva198418-May-07 1:00
psiva198418-May-07 1:00 

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.