From: John T. <jr...@gt...> - 2003-02-25 00:50:30
|
Hi, I would like to use The Delphi Example provided on the Borland web-site ( http://bdn.borland.com/article/0,1410,28974,00.html ) showing data connectivity to MS Sql server with your provider to Firebird. Not sure if your product fits the bill but I'm not sure how to use it either. Will be happy to provide finished solution to the list. TIA John <%@ Page Language="delphi" %> <%@ import Namespace="System.Data" %> <%@ import Namespace="System.FirebirdSql.Data.Firebird" %> <script runat="server"> const ProdName = 'Delphi for .NET'; DispFields = 'OrderID, CustomerID, ShipName, ShipCity, ShipCountry'; procedure DateSelected(Sender: System.Object; E: EventArgs); begin Label1.Text := ProdName + ' says you picked ' + Calendar1.SelectedDate.ToString('D'); DataGrid1.DataSource := GetOrders(Calendar1.SelectedDate); DataGrid1.DataBind; end; procedure Button1Click(Sender: System.Object; E:EventArgs); begin Calendar1.VisibleDate := System.Convert.ToDateTime(Edit1.Text); Label1.Text := ProdName + ' says you set ' + Calendar1.VisibleDate.ToString('D'); end; procedure Button2Click(Sender: System.Object; E:EventArgs); begin DisplayFields.Text := DispFields; end; function GetOrders(Date : DateTime) : DataSet; var Adapter : OleDbDataAdapter; conn: OleDbConnection; // (connection) ds: DataSet; ct,ii,x:integer; begin // Not sure of the next line Conn := OleDbConnection.create('Provider=FirebirdSql;Location=127.0.0.1;Data Source=d:\projects\data\DIS.GDB, SYSDBA, masterkey'); Adapter := OleDbDataAdapter.Create('select * from codes where code_id= 2 ',Conn); ds := DataSet.Create; Adapter.Fill(ds); Label2.Text := 'adapter fill';// end; </script> <html> <head> </head> <body style="FONT: 18pt Verdana"> <form runat="server"> <h1><%=ProdName %>with a Calendar, DataGrid, & SqlClient in ASP.NET </h1> <table> <tbody> <tr valign="top"> <td> <p> <b>Pick a date</b> </p> <asp:Calendar id="Calendar1" runat="server" ForeColor="#0000FF" BackColor="#FFFFCC" OnSelectionChanged="DateSelected"> <TodayDayStyle font-bold="True" /> <NextPrevStyle forecolor="#FFFFCC" /> <DayHeaderStyle backcolor="#FFCC66" /> <SelectedDayStyle forecolor="Black" backcolor="#CCCCFF" /> <TitleStyle font-size="14pt" font-bold="True" forecolor="#FFFFCC" backcolor="#990000" /> <OtherMonthDayStyle forecolor="#CC9966" /> </asp:Calendar> <p> <asp:TextBox id="Edit1" runat="server" width="150"></asp:TextBox> <asp:Button id="Button1" onclick="DateSelected" runat="server" text="Set date"></asp:Button> </p> </td> <td valign="top"> <p> <b>Display fields:</b> <asp:TextBox id="DisplayFields" runat="server" width="500" text="OrderID, CustomerID, ShipName, ShipCity, ShipCountry"></asp:TextBox> <asp:Button id="Button2" onclick="Button2Click" runat="server" text="Reset fields"></asp:Button> </p> <asp:DataGrid id="DataGrid1" runat="server" ForeColor="#0000FF" BorderColor="#FFCC66"> <HeaderStyle forecolor="#FFFFCC" backcolor="#990000" /> </asp:DataGrid> </td> </tr> </tbody> </table> <p> <asp:Label id="Label1" runat="server"></asp:Label> </p> <p> <asp:Label id="Label2" runat="server"></asp:Label> </p> </form> </body> </html> |