Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

i have a class that I've tried to make into a datasource with the wizard. when I do a debug.writeline and step through the each row in the

 

ex:

 

For Each oemail In oEmails

 

Debug.WriteLine(oemail.EmailAddress)

 

Next

 

i see my 27 rows of data. however, when I drag the "Email" datasource as a datagridview to my form.. the data isn't showing up in the grid. What am I not doing that the two are not wired together. I looked in my EmailBindingSource and it says that the datasource is Email... but it's still not working..

 

also.. when I drop the datasource on the form... no lines of code are added.. I don't know there there are suppose to be any.. but figured I'd mention it. Seems to me there should be something... otherwise how does it know to grab the data from the datasource object after the object is laoded up

 

What it did add to the design is a BindingSource and a BindingNavigator.

any help would be great.

thanks

shannon

JvCoach23

VB.Net newbie

MS Sql Vet

Posted

If you had the code/project to post that might help.

 

This is really new waters. I'm not sure how many people have taken the jump to 2005 yet.

 

Based on what you're saying, I can't see anything wrong - but maybe a sample project with the problem might help.

Posted

i got it figured out. there is pluming that has to go on.. Here is the line of code that was needed.

 

Me.EmailsBindingSource.DataSource = oEmails

 

I had tried that before.. but was trying to have a datasource = Emails.. which was my class... instead of going after what had been instantiated.. think that is the right term.. anyway... here is what the complete code looks like

 

Public Class frmMain


   Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
       Dim oemail As asr.Email
       Dim oEmails As New asr.Emails

       With oEmails
           .sEmail = "steve"
           .LoadFromDb()
           oEmails = .Load("")
       End With
       For Each oemail In oEmails
           Debug.WriteLine(oemail.EmailAddress)
       Next

       Me.EmailsBindingSource.DataSource = oEmails

   End Sub

 

wow.. glad i got past this one.. on to the next one..

thanks

shannon

 

If you had the code/project to post that might help.

 

This is really new waters. I'm not sure how many people have taken the jump to 2005 yet.

 

Based on what you're saying, I can't see anything wrong - but maybe a sample project with the problem might help.

JvCoach23

VB.Net newbie

MS Sql Vet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...