Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 More Questions with VS2010 and SQL

Author  Topic 

mulefeathers
Starting Member

12 Posts

Posted - 2012-10-22 : 16:34:08
Have created a VB front end that connects to a SQL DB. The connection is made. It has been a long time since I did any VB programming so I'm rusty. It is a basic 2 form design with the second form opening from a click event from the main form.

With this line in the 2nd form load event:

Me.TblSymbolsTableAdapter.Fill(Me.KanbanDataSet.tblSymbols)

It will populate the text boxes with the first row of data. For now all I want to do is navagate through the records but later on I will add, remove, and edit.

I am tryign to use the following code for navigation.
Private m_Datatable As New DataTable
Private m_rowPosition As Integer = 0
Dim m_Datarow As DataRow = m_Datatable.Rows(0)

Private Sub ShowCurrentRecord()
If m_Datatable.Rows.Count > 0 Then
txtprocess.Text = ""
txtsymbolid.Text = ""
txtsymbolname.Text = ""

End If
txtprocess.Text = m_Datatable.Rows(m_rowPosition)("Process").ToString()
txtsymbolid.Text = m_Datatable.Rows(m_rowPosition)("Symbol_ID").ToString()
txtsymbolname.Text = m_Datatable.Rows(m_rowPosition)("SymbolName").ToString()

This is for the next button:
If m_rowPosition < (m_Datatable.Rows.Count - 1) Then
m_rowPosition = m_rowPosition + 1
Me.ShowCurrentRecord()

When I attempt to open the form I receive the error:

An error occurred creating the form. See Exception.InnerException for details. The error is: There is no row at position 0.

This should be easy but.....

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2012-10-23 : 06:31:45
That error is telling you that KanbanDataSet.tblSymbols has no data in it. Look at what the fill method is doing for your adapter.








How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Go to Top of Page

Niki
Yak Posting Veteran

51 Posts

Posted - 2012-10-23 : 11:54:36
I have installed SSMS 2008 R2; the Visual Studio 2008 that got installed seems like incomplete installation. Can I repair it without messing up SS manageament Studio?

Niki
Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2012-10-24 : 10:00:12
You should be able to remove/reinstall VS without hurting your SSMS install.








How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Go to Top of Page

Niki
Yak Posting Veteran

51 Posts

Posted - 2012-10-24 : 18:33:35
Thank you!

Niki
Go to Top of Page
   

- Advertisement -