Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Repeaters and DatabindingRepeaters and Databinding
Previous
 
Next
New Post
3/11/2009 3:35 PM
 

Help,

A complete .net/c# novice.  I have the following code in my aspx file:
<asp:Repeater ID="Repeater1" runat="server">
            <HeaderTemplate><table width="100%"><tr><th>Address</th><th>Town</th><th>Plastics Date</th></tr></HeaderTemplate>
                <ItemTemplate>
                    <tr><td><%#DataBinder.Eval(Container.DataItem, "ADDRESS")%></td>
                    <td><%#DataBinder.Eval(Container.DataItem, "TOWN")%></td>
                    <td><%#DataBinder.Eval(Container.DataItem, "PLASTICS_DAY")%></td>           
                    </tr>
                   
                     </ItemTemplate>
            <FooterTemplate></table></FooterTemplate>
            </asp:Repeater>

and in my cs code behind I have:
public void DisplaySearchResults(string strSearch, string strTown ,string Plastics_Select)
        {
            string Town_Select;
            Town_Select = LBHAreaDropdown.SelectedItem.Text;
            Plastics_Select = CollectionTypes.SelectedValue.ToString();
           
            if (Town_Select != null )
            {
                    SqlCommand cmd2 = new SqlCommand("DDValue_One_Town", new SqlConnection(ConfigurationManager.AppSettings["ConnString"]));
                    cmd2.CommandType = CommandType.StoredProcedure;
                    cmd2.Parameters.AddWithValue("@SearchString", strSearch);
                    cmd2.Parameters.AddWithValue("@Townname", strTown);
                   
                   
                    cmd2.Connection.Open();
                    Repeater1.DataSource = cmd2.ExecuteReader();
                    Repeater1.DataBind();
                    cmd2.Connection.Close();
                    cmd2.Connection.Dispose();
}

The above is not the full code listing.  The ADDRESS and TOWN are binding in the repeater OK and returning the results of my SQL string. All I wanted to do is add a third column form the same SQl table which returns a day of the week.  This value is not entered on the web page but is what the user is looking for.  I don't know how to fetch the result from my table.  here is the SQL in the stored procedure:
SELECT     ADDRESS, TOWN, PLASTICS_DAY
FROM         RECYCLING_DAYS
WHERE     (ADDRESS LIKE '%' + @SearchString + '%') AND (TOWN = @TownName)

Really getting massively confused.  Please help....

 
New Post
3/11/2009 8:53 PM
 

hi ... as an alternative to do the work yourself I suggest you consider SQLGridSelectedView from my site www.tressleworks.com  or SQLView from www.dnnstuff.com ..   Either of these modules will provide the ability to load a SQL query and format the result.

Beat having to do the coding ... 

SQLGridSelectedView from www.tressleworks.ca is availabe for free, however you can also subscribe to the site and obtain the modules -- and others -- for as little as $10.   OK .. end of add.

You will find there are several example of this type of modules available for DNN ... includeing the Reports modules that includes the source .. worth reviewing.

Paul. 

 

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Repeaters and DatabindingRepeaters and Databinding


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out