how to deploy the delphi for .net winform applicaiton
thx david suggestion , i follow your suggestion copy
Borland.Data.Common.dll,Borland.Data.Provider.dll, Borland.Delphi.dll to
project1.exe same path ..
but still got following error..i capture more infomation below ..program
code and error message.
please help.
Delphi program code
unit WinForm1;
interface
uses
System.Drawing, System.Collections,
System.ComponentModel,
System.Windows.Forms, System.Data,
Borland.Data.Provider,
Borland.Data.Common,
Borland.Data.MSSQL;
type
TWinForm1 = class(System.Windows.Forms.Form)
{$REGION 'Designer Managed Code'}
strict private
/// <summary>
/// Required designer variable.
/// </summary>
Components: System.ComponentModel.Container;
Button1: System.Windows.Forms.Button;
RichTextBox1: System.Windows.Forms.RichTextBox;
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure InitializeComponent;
procedure Button1_Click(sender: System.Object; e: System.EventArgs);
{$ENDREGION}
strict protected
/// <summary>
/// Clean up any resources being used.
/// </summary>
procedure Dispose(Disposing: Boolean); override;
private
{ Private Declarations }
public
constructor Create;
end;
[assembly: RuntimeRequiredAttribute(TypeOf(TWinForm1))]
implementation
{$AUTOBOX ON}
{$REGION 'Windows Form Designer generated code'}
/// <summary>
/// Required method for Designer support -- do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure TWinForm1.InitializeComponent;
begin
Self.Button1 := System.Windows.Forms.Button.Create;
Self.RichTextBox1 := System.Windows.Forms.RichTextBox.Create;
Self.SuspendLayout;
Self.Button1.Location := System.Drawing.Point.Create(32, 16);
Self.Button1.Name := 'Button1';
Self.Button1.Size := System.Drawing.Size.Create(96, 80);
Self.Button1.TabIndex := 0;
Self.Button1.Text := 'Button1';
Include(Self.Button1.Click, Self.Button1_Click);
Self.RichTextBox1.Location := System.Drawing.Point.Create(32, 128);
Self.RichTextBox1.Name := 'RichTextBox1';
Self.RichTextBox1.Size := System.Drawing.Size.Create(352, 216);
Self.RichTextBox1.TabIndex := 1;
Self.RichTextBox1.Text := 'RichTextBox1';
Self.AutoScaleBaseSize := System.Drawing.Size.Create(5, 15);
Self.ClientSize := System.Drawing.Size.Create(416, 382);
Self.Controls.Add(Self.RichTextBox1);
Self.Controls.Add(Self.Button1);
Self.Name := 'TWinForm1';
Self.Text := 'WinForm1';
Self.ResumeLayout(False);
end;
{$ENDREGION}
procedure TWinForm1.Dispose(Disposing: Boolean);
begin
if Disposing then
begin
if Components <> nil then
Components.Dispose();
end;
inherited Dispose(Disposing);
end;
constructor TWinForm1.Create;
begin
inherited Create;
InitializeComponent;
end;
const
ConnPrefixMSSQL = 'assembly=Borland.Data.Mssql,Version=2.0.0.0,
Culture=neutral, ' +
'PublicKeyToken=91d62ebb5b0d1b1b;vendorclient=sqlo ledb.dll;'
+
'Provider=MSSQL;';
ConnDetailsMSSQL =
'database=Northwind;username=sa;password=password; hostname=hostname';
var
ConnectionString: string;
Connection: BDPConnection;
Command: BDPCommand;
Reader: BDPDataReader;
Value1: string;
procedure TWinForm1.Button1_Click(sender: System.Object; e:
System.EventArgs);
begin
ConnectionString := ConnPrefixMSSQL + ConnDetailsMSSQL;
Connection := BDPConnection.Create(ConnectionString);
Connection.Open;
Command := Connection.CreateCommand;
Command.CommandText := 'Select city from customers';
Reader := Command.ExecuteReader;
Self.RichTextBox1.Text:='';
while reader.Read do
begin
Value1 := Reader.GetString(0);
Self.Button1.Text :=Value1;
Self.RichTextBox1.Text:=Self.RichTextBox1.Text+Val ue1+chr(13) ;
end;
Reader.Free;
Command.Close;
Connection.Close;
end;
end.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.IO.FileLoadException: The located assembly's manifest definition with
name 'Borland.Data.Provider' does not match the assembly reference.
File name: "Borland.Data.Provider"
at WinForm1.TWinForm1.Button1_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
=== Pre-bind state information ===
LOG: DisplayName = Borland.Data.Provider, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=91d62ebb5b0d1b1b
(Fully-specified)
LOG: Appbase = C:\Project5\
LOG: Initial PrivatePath = NULL
Calling assembly : Project1, Version=1.0.1871.17249, Culture=neutral,
PublicKeyToken=null.
===
LOG: Publisher policy file is not found.
LOG: Host configuration file not found.
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\confi g\machine.config.
LOG: Post-policy reference: Borland.Data.Provider, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=91d62ebb5b0d1b1b
LOG: Attempting download of new URL
file:///C:/Project5/Borland.Data.Provider.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
Project1
Assembly Version: 1.0.1871.17249
Win32 Version: 1.0.1871.17249
CodeBase: file:///C:/Project5/Project1.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
Accessibility
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windows/assembly/gac/accessibility/1.0.5000.0__b03f5f7f11d50a3a/accessibility.dll
----------------------------------------
************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
"David Wil****son" <dnwatlibriosdotcom> ¼¶¼g©ó¶l¥ó·s»D:420e64fd$1@newsgroups.borland.com.. .
|