Novice Problems

Hi All, 

I am trying to do the following in a WinForm

I need to run a stored procedure, read the values for each row, and then send an email.

the columns being passed are 
Name of Attachment
Name of the Receiver 
Subject

So, I need to read each row, pick the attachment , pick the name of the person, and the subject and send the email.

It would seem pretty simple in WebForms but with WinForms, i can't seem to understand how to go about it. 

Is there any reference or assistances on how i can go about it.

I did try to populate a DataGrid, except that when i see the datagrid, it shows a small plus sign, then the name 'table' and then when i click on the link, it then display the dataset in the datagrid.

I am looking for help.

Thank You


Answer this question

Novice Problems

  • AdKhan

    I'm thinking this might help a little

    http://www.planet-source-code.com/vb/scripts/ShowCode.asp txtCodeId=2225&lngWId=10

    also you must always set the datasource to dataset and the datamember to the datatable in the dataset. 

    Now to select the current row that the datagrid is on you would do in the double click event of the datagrid something like.

    Dim CM as currencymanager = ctype(me.bindingcontext(me.datagrid1.datasoruce,me.datagrid1.datamember),currencymanager)
    if cm.position > 0 then
    Dim DRV as datarowview = ctype(cm.current,datarowview)
    'then use the drv to gain the data
    Dim Name as string
    name = drv.item("NameColumn")
    end if

    Hope this helps.

  • Novice Problems