Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 45
  • Last Modified:

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
0
eladr
Asked:
eladr
  • 3
  • 2
1 Solution
 
jitgangulyCommented:
Change the following
strSQL="select * from intercal
to
strSQL="select {yourfiledname} from intercal
0
 
Michel SakrCommented:
strSQL="select * from intercall where [field selection criteria]"

or
strSQL="select 1 from intercall"
depends what do you want to show
0
 
eladrAuthor Commented:
is this the only way?
what are the other properties besides defaultView?

MyDataGrid.DataSource=ds.Tables("intercall").DefaultView
   
elad
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
eladrAuthor Commented:
no one was specific with right answer
0
 
jitgangulyCommented:
Does that mean you provide a 'C' grade ? You could delete the question ?
0
 
eladrAuthor Commented:
i shouldnt accepted the que,but i saw EE cancel the
delete option.
elad
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now