Link to home
Start Free TrialLog in
Avatar of eladr
eladr

asked on

another asp+

i used this code to populate sql server table in asp+
...
<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
    Dim DS As DataSet
    Dim MyConnection As ADOConnection
    Dim MyCommand As ADODataSetCommand
    dim strconn as string
    dim strSQL as string
   
    strconn ="DSN=test;uid=test;pwd=testing;database=eladr"
   
    strSQL="select * from intercall"
      
    MyConnection = New ADOConnection(strconn)
    MyCommand = New ADODataSetCommand(strSQL,MyConnection)

    DS = new DataSet()
    MyCommand.FillDataSet(ds, "intercall")

    MyDataGrid.DataSource=ds.Tables("intercall").DefaultView
    MyDataGrid.DataBind()
End Sub
</script>
...

how can i change the code to display only one filed and not all fields in db?

elad
ASKER CERTIFIED SOLUTION
Avatar of jitganguly
jitganguly

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Michel Sakr
strSQL="select * from intercall where [field selection criteria]"

or
strSQL="select 1 from intercall"
depends what do you want to show
Avatar of eladr
eladr

ASKER

is this the only way?
what are the other properties besides defaultView?

MyDataGrid.DataSource=ds.Tables("intercall").DefaultView
   
elad
Avatar of eladr

ASKER

no one was specific with right answer
Does that mean you provide a 'C' grade ? You could delete the question ?
Avatar of eladr

ASKER

i shouldnt accepted the que,but i saw EE cancel the
delete option.
elad