Jump to content

ewhitmor

Members
  • Posts

    5
  • Joined

  • Last visited

ewhitmor's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. You need to use SQL Server Management Studio Express CTP. This will allow you to login into the database/ run quieries and create tables as well as manage security. I believe this comes with the install of sql 2k5 but if not just google it. Its a free M$ download. SQL language is used to communite with the database. Goto:http://www.w3schools.com/sql/default.asp for more information on that.
  2. One of the best tutorials i found was:http://www.dotnetspider.com/tutorials/AspNet-Tutorials.aspx
  3. ewhitmor

    DataList Help

    I have been searching and searching and need some help. I am working a datalist control in ASP.NET 2.0. The datalist is connected to an SQL 2000 server and working just fine. My problem is that some of the fields in a record are blank and i want to suppress them.For example:One of my fields is Add2. No all people need a second address line so i want o supress it for them but display it for the others. Here is my code: <asp:DataList ID="table" runat="server" CellPadding="2" DataKeyField="IDNumber" DataSourceID="MarketplaceData" RepeatColumns="1" GridLines="Both" RepeatLayout="table" Width = "600px" ItemStyle-Font-Bold="true"> <ItemTemplate> <asp:Label ID="COMPANYLabel" runat="server" Text='<%# Eval("COMPANY") %>'></asp:Label><br /> <asp:Label ID="CONTACTLabel" runat="server" Text='<%# Eval("CONTACT") %>'></asp:Label><br /> <asp:Label ID="TITLELabel" runat="server" Text='<%# Eval("TITLE") %>'></asp:Label><br /> <asp:Label ID="ADD1Label" runat="server" Text='<%# Eval("ADD1") %>'></asp:Label><br /> <asp:Label ID="ADD2Label" runat="server" Text='<%#Eval("ADD2")%>'></asp:Label><br /> <asp:Label ID="CITYLabel" runat="server" Text='<%# Eval("CITY") %>'></asp:Label>, <asp:Label ID="ST_PROVLabel" runat="server" Text='<%# Eval("[ST/PROV]") %>'></asp:Label> <asp:Label ID="ZIPLabel" runat="server" Text='<%# Eval("ZIP") %>'></asp:Label><br /> <asp:Label ID="COUNTRYLabel" runat="server" Text='<%# Eval("COUNTRY") %>'></asp:Label><br /> PHONE: <asp:Label ID="PHONELabel" runat="server" Text='<%# Eval("PHONE") %>'></asp:Label><br /> FAX: <asp:Label ID="FAXLabel" runat="server" Text='<%# Eval("FAX") %>'></asp:Label><br /> TOLLFREE: <asp:Label ID="TOLLFREELabel" runat="server" Text='<%# Eval("TOLLFREE") %>'></asp:Label><br /> <asp:HyperLink ID="HyperLink2" NavigateUrl='<%# "mailto:" & Eval("EMAIL") %>' runat="server"><%# Eval("EMAIL") %></asp:HyperLink><br /> <asp:HyperLink ID="HyperLink1" NavigateUrl='<%# "http://" & Eval("WEBSITE") %>' Target=_blank" runat="server"><%#Eval("WEBSITE")%></asp:HyperLink><br /> SERVICES:<asp:Label ID="Label1" runat="server" Text='<%# Eval("SERVICES") %>'></asp:Label><br /> MemberSince: <asp:Label ID="MemberSinceLabel" runat="server" Text='<%# Eval("MemberSince") %>'></asp:Label><br /> P3PARTICIPANT: <asp:Label ID="P3PARTICIPANTLabel" runat="server" Text='<%# Eval("P3PARTICIPANT") %>'></asp:Label><br /></ItemTemplate> <AlternatingItemStyle BackColor="LightSteelBlue" /></asp:DataList> When using <%# Eval("COMPANY") %> i cant use logic like if len(Eval("ADD2")) = 0 then do something endifI am lost... can someone help me?!!!! Plz for the love of GOD!
  4. I figured it out but i still think M$ needs to make this easier in thier next version of ASP.Net.Here is how i did it. Dim total_amtpaid As Decimal Dim total_disc As Decimal Dim total_fs As Decimal Dim total_assl As Decimal Dim total_Net As Decimal Dim total_Weight As Decimal Protected Sub TotIncurGrid_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound 'Sum Columns If e.Row.RowType = DataControlRowType.DataRow Then total_Weight += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Weight")) total_Net += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Net")) total_assl += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Accessorial")) total_fs += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "FS")) total_disc += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Disc")) total_amtpaid += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "AmtPaid")) ElseIf e.Row.RowType = DataControlRowType.Footer Then e.Row.Cells(9).Text = "<strong>Totals:</strong>" ' for the Footer, display the running totals e.Row.Cells(10).Text = total_Weight.ToString("n0") e.Row.Cells(11).Text = total_Net.ToString("c") e.Row.Cells(12).Text = total_assl.ToString("c") e.Row.Cells(13).Text = total_fs.ToString("c") e.Row.Cells(14).Text = total_disc.ToString("c") e.Row.Cells(15).Text = total_amtpaid.ToString("c") e.Row.HorizontalAlign = HorizontalAlign.Right e.Row.Font.Bold = False e.Row.Font.Size = 9 End If End Sub
  5. Hi all,I am in the beginning stages of learning asp.net and have a question about GridView. I have data that i am trying to display. I am able to display it without problem but i want to total a couple columns in the footer area below the columns. Everything i have read has me doing a bunch of wierd work arounds. Here is what i got so far: <%@ Page Language="VB" %><%@ Import Namespace="System.Data" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> </script><html xmlns="http://www.w3.org/1999/xhtml" ><head> <title>enVision Utilities Web</title></head><body> <form runat="server"> <asp:GridView ID="GridView1" runat="server" DataSourceID="enVisionData" ForeColor="#333333" GridLines="None" AutoGenerateColumns="False" RowStyle-Font-Size="9" AllowSorting="false" ShowFooter = "true" RowStyle-Wrap = "false" > <HeaderStyle BackColor="DarkGreen" Font-Bold="True" ForeColor="White" /> <RowStyle BackColor="#fbf6e0" ForeColor="Black" HorizontalAlign="Center" /> <AlternatingRowStyle BackColor="White" ForeColor="Black"/> <FooterStyle BackColor="#fbf6e0" /> <Columns> <asp:BoundField DataField="Carrier" SortExpression="Carrier" HeaderText="Carrier" ItemStyle-HorizontalAlign="center" /> <asp:BoundField DataField="ProNumber" SortExpression="ProNumber" HeaderText="ProNumber" /> <asp:BoundField DataField="ShipDate" SortExpression="ShipDate" HeaderText="ShipDate" ItemStyle-HorizontalAlign="center" HtmlEncode="false" DataFormatString="{0:MM/dd/yyyy}" /> <asp:BoundField DataField="Shipper" SortExpression="Shipper" HeaderText="Shipper" ItemStyle-HorizontalAlign="center" /> <asp:BoundField DataField="SCity" SortExpression="SCity" HeaderText="SCity" ItemStyle-HorizontalAlign="center"/> <asp:BoundField DataField="SSt" SortExpression="SSt" HeaderText="SSt" ItemStyle-HorizontalAlign="center"/> <asp:BoundField DataField="Consignee" SortExpression="Consignee" HeaderText="Consignee" ItemStyle-HorizontalAlign="center"/> <asp:BoundField DataField="CCity" SortExpression="CCity" HeaderText="CCity" ItemStyle-HorizontalAlign="center"/> <asp:BoundField DataField="CSt" SortExpression="CSt" HeaderText="CSt" ItemStyle-HorizontalAlign="center"/> <asp:BoundField DataField="Mode" SortExpression="Mode" HeaderText="Mode" ItemStyle-HorizontalAlign="center"/> <asp:BoundField DataField="Weight" SortExpression="Weight" HeaderText="Weight" HtmlEncode="false" ItemStyle-HorizontalAlign="right" DataFormatString="{0:#,###}" /> <asp:BoundField DataField="Net" SortExpression="Net" HeaderText="Net" HtmlEncode="false" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="right" /> <asp:BoundField DataField="Accessorial" SortExpression="Accessorial" HeaderText="Accessorial" HtmlEncode="false" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="right"/> <asp:BoundField DataField="FS" SortExpression="FS" HeaderText="FS" HtmlEncode="false" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="right"/> <asp:BoundField DataField="Disc" SortExpression="Disc" HeaderText="Disc" HtmlEncode="false" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="right"/> <asp:BoundField DataField="AmtPaid" SortExpression="AmtPaid" HeaderText="AmtPaid" HtmlEncode="false" DataFormatString="{0:C}" ItemStyle-HorizontalAlign="right"/> </Columns> </asp:GridView> <asp:SqlDataSource ID="enVisionData" runat="server" ConnectionString="Data Source=XXX.XXX.XXX.XXX;Initial Catalog=enVisionDataSQL;Persist Security Info=True;User ID=XXXXXXXXXX;PWD=XXXXXXXXX" SelectCommand="sp_eric_ole_data" SelectCommandType="StoredProcedure" > <SelectParameters> <asp:Parameter DefaultValue="9/1/2006" Name="StrDate" Type="DateTime" /> <asp:Parameter DefaultValue="9/15/2006" Name="EndDate" Type="DateTime" /> <asp:Parameter DefaultValue="<ROOT><Client ClientID='2'/></ROOT>" Name="ClientIDs" Type="String" /> </SelectParameters> </asp:SqlDataSource> </form></body></html> This website gives you an idea of what i am trying to do: Example PageThanks for your help,Eric
×
×
  • Create New...