Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 27th, 2007, 10:30 PM
Authorized User
Points: 395, Level: 6
Points: 395, Level: 6 Points: 395, Level: 6 Points: 395, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2007
Location: London, , United Kingdom.
Posts: 73
Thanks: 4
Thanked 0 Times in 0 Posts
Default Accessing Object of Database

Hi
I am trying to use the calender control from the website , i am trying to create the function

Protected Function DisplayDaysOnJob(ByVal employee As
Northwind.EmployeesRow) As String



but the problem is i couldnt get the object of Northwind.EmployeeRow ....

I have used the SQL Datasource in this whole exercise....

Code is Give bellow:



1 <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="ItemTemplate.aspx.vb" Inherits="GridViewRetriefValues.ItemTemplate" %>
2
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5 <html xmlns="http://www.w3.org/1999/xhtml" >
6 <head runat="server">
7 <title>Untitled Page</title>
8 </head>
9 <body>
10 <form id="form1" runat="server">
11 <div>
12 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
13 SelectCommand="SELECT [EmployeeID], [LastName], [FirstName], [TitleOfCourtesy], [City], [Country], [HireDate] FROM [Employees]">
14 </asp:SqlDataSource>
15 <asp:Button ID="Button2" runat="server" Style="position: relative" Text="Show Records" />&nbsp;
16 <asp:GridView ID="GridView1" runat="server" CellPadding="4" DataMember="DefaultView"
17 DataSourceID="SqlDataSource1" Style="left: 32px;
18 position: relative; top: 43px" Visible="False" AutoGenerateColumns="False" BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px">
19 <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
20 <RowStyle BackColor="White" ForeColor="#330099" />
21 <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
22 <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
23 <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
24 <Columns>
25 <asp:BoundField DataField="EmployeeID" HeaderText="EmployeeID" InsertVisible="False"
26 ReadOnly="True" SortExpression="EmployeeID" />
27 <asp:TemplateField HeaderText="TitleOfCourtesy" SortExpression="TitleOfCourtesy">
28 <EditItemTemplate>
29 <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("TitleOfCourtesy") %>'></asp:TextBox>
30 </EditItemTemplate>
31 <HeaderTemplate>
32 Full Name
33 </HeaderTemplate>
34 <ItemTemplate>
35 <asp:Label ID="Label1" runat="server" Text='<%# Eval("TitleOfCourtesy") %>'></asp:Label>
36 <asp:Label ID="Label2" runat="server" Style="position: relative" Text='<%# Eval("FirstName") %>'></asp:Label>
37 <asp:Label ID="Label3" runat="server" Style="position: relative" Text='<%# Eval("LastName") %>'></asp:Label>
38 </ItemTemplate>
39 </asp:TemplateField>
40 <asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
41 <asp:BoundField DataField="Country" HeaderText="Country" SortExpression="Country" />
42 <asp:TemplateField HeaderText="HireDate" SortExpression="HireDate">
43 <EditItemTemplate>
44 <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("HireDate") %>'></asp:TextBox>
45 </EditItemTemplate>
46 <ItemTemplate>
47 <asp:Calendar ID="Calendar1" runat="server" BackColor="#FFFFCC" BorderColor="#FFCC66"
48 BorderWidth="1px" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
49 ForeColor="#663399" Height="200px" SelectedDate='<%# Eval("HireDate") %>' ShowGridLines="True"
50 Style="position: relative" VisibleDate='<%# Eval("HireDate") %>' Width="220px">
51 <SelectedDayStyle BackColor="#CCCCFF" Font-Bold="True" />
52 <TodayDayStyle BackColor="#FFCC66" ForeColor="White" />
53 <SelectorStyle BackColor="#FFCC66" />
54 <OtherMonthDayStyle ForeColor="#CC9966" />
55 <NextPrevStyle Font-Size="9pt" ForeColor="#FFFFCC" />
56 <DayHeaderStyle BackColor="#FFCC66" Font-Bold="True" Height="1px" />
57 <TitleStyle BackColor="#990000" Font-Bold="True" Font-Size="9pt" ForeColor="#FFFFCC" />
58 </asp:Calendar>
59 </ItemTemplate>
60 </asp:TemplateField>
61 </Columns>
62
63
64
65 </asp:GridView>
66 </div>
67 </form>
68 </body>
69 </html>
70




Cheers
Sheraz
__________________
Cheers
Sheraz




Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing elements of an Array object abdulqadirpk VB How-To 1 April 2nd, 2007 11:13 AM
Accessing WORD object in ASP mcinar Classic ASP Basics 5 March 30th, 2005 04:19 PM
Accessing ASP Application Object from .NET yuvalk ASP.NET 1.x and 2.0 Application Design 2 July 19th, 2004 10:29 AM
Accessing page object within an IFRAME drettberg ASP.NET 1.0 and 1.1 Professional 3 September 22nd, 2003 11:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.