Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
P

phoeno29

@phoeno29
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Getting data from two tables in a repeater
    P phoeno29

    Thanks Daniel for the reply. I did think of the join in the query but brushed past it as I was keen to see what .net had to offer. Ultimately the page is to be searched on, and all boats regardless of matching the criteria are to be displayed. Those that match the criteria are to have an image in colour of the boat and the non search matching boats to be greyed out (A black and white pic of the same boat) I did the whole exercise in under 2 hours in classic asp but am getting no where fast in .net !

    ASP.NET csharp asp-net database sysadmin algorithms

  • Getting data from two tables in a repeater
    P phoeno29

    Hi, I am new to asp.net but have learnt a lot through the tutorials and random searching here and elsewhere. Have many years expereince with classic ASP but this task I am working on is sending me around the bend ! I want to have a nested repeater (this bit I understand fine) but am unsure how to make my data from two tables in the one database join together. I have a table called boatcats which list a few different categoies of boat and I have a second table called 'boats' that list all of the boats and their details. The two tables share boatcats.ID and boats.catid I doubt my code is heading in the right direction and I am unsure how to link the two queries. I am using VB not C# and should I be doing this sort of thing at code level (which I am used to in asp classic or with Visual Web Developer 2005) Code so far is.... Sub Page_Load(sender as Object, e as EventArgs) If Not Page.IsPostBack then BindData() 'Only bind the data on the first page load End If End Sub Sub BindData() dim dbconn,strq,dbcomm,dbread dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & server.mappath("boats.mdb")) dbconn.Open() strq = "Select * from boatcats" dbcomm=New OleDbCommand(strq,dbconn) dbread=dbcomm.ExecuteReader() boatcats.DataSource=dbread boatcats.DataBind() dbread.Close() dbconn.Close() End Sub Sub BindData2() dim dbconn2,strq2,dbcomm2,dbread2,boats2 dbconn2=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & server.mappath("boats.mdb")) dbconn2.Open() strq2 = "Select * from boats" dbcomm2=New OleDbCommand(strq2,dbconn2) dbread2=dbcomm2.ExecuteReader() boats.DataSource=dbread2 boats.DataBind() dbread2.Close() dbconn2.Close() end sub I havn't added the asp:repeater section, this I have no problems with. Any help appreciated. Martin

    ASP.NET csharp asp-net database sysadmin algorithms
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups