Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change GridView DataSource

Status
Not open for further replies.

litton1

Technical User
Apr 21, 2005
584
GB
Hi all, I am trying to follow a tutorial on template fields but it uses Access and i am using sql sever 2000.
how do i change the data source from this to sql server 2000?
Code:
<asp:AccessDataSource id="TypeSource" Runat="Server"
  DataFile="../Databases/eCommerce.mdb"
  SelectCommand="SELECT DISTINCT ItemType FROM Products ORDER BY ItemType"/>

...
<asp:TemplateField HeaderText="Type" ItemStyle-VerticalAlign="Top">
  <ItemTemplate>
    <asp:Label Text='<%# Eval("ItemType") %>' Runat="Server"/>
  </ItemTemplate>
  <EditItemTemplate>
    <asp:DropDownList id="EditType" DataSourceID="TypeSource" Runat="Server"
      DataTextField="ItemType" DataValueField="ItemType" SelectedValue='<%# Bind("ItemType") %>'/>
  </EditItemTemplate>
</asp:TemplateField>

I cannot find a tag same as this <asp:AccessDataSource for sql sever (could be me [banghead] ... )?
Thx T.

Age is a consequence of experience
 
<asp:SqlDataSource ... />

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Thx Jason, cannot see wood for trees [purpleface]

Age is a consequence of experience
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top