|
Тема |
Re: Za ODBC s Firebird [re: na6ovek] |
|
Автор | neznaest (Нерегистриран) | |
Публикувано | 25.11.05 08:56 |
|
|
Ползвам кода Imports FirebirdSql.Data.Firebird
Imports System.Data.OleDb
Public Class Form1
Inherits System.Windows.Forms.Form
Dim frb As New FbCommand(), ConStr As String, cs As New FbConnectionStringBuilder()
Dim transaction As FbTransaction
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 15)
Me.ClientSize = New System.Drawing.Size(520, 312)
Me.Name = "Form1"
Me.Text = "Form1"
End Sub
#End Region
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
cs.DataSource = "localhost"
cs.Database = "D:\\S\\lizing-new.cit"
cs.UserID = "SYSDBA"
cs.Password = "masterkey"
cs.Dialect = 3
cs.Port = 3050
ConStr = cs.ToString
frb.Connection = New FbConnection(ConStr)
frb.CommandText = "Select T_Nomenk_109.* from T_Nomenk_109"
Try
frb.Connection.Open()
transaction = frb.Connection.BeginTransaction
transaction.Commit()
frb.Connection.Close()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
End Class
и ми дава следната грешка: System.TypeLoadException: Invalid PInvoke metadata format.
at System.Net.OSSOCK.gethostbyname(String host)
at System.Net.Dns.GetHostByName(String hostName)
at System.Net.Dns.Resolve(String hostName)
at FirebirdSql.Data.Gds.GdsConnection.Connect(String dataSource, Int32 port, Int32 packetSize, Charset charset)
at FirebirdSql.Data.Gds.GdsDatabase.Attach(DatabaseParameterBuffer dpb, String dataSource, Int32 port, String database)
at FirebirdSql.Data.Firebird.FbConnectionInternal.Connect()
at FirebirdSql.Data.Firebird.FbConnectionPool.Create()
at FirebirdSql.Data.Firebird.FbConnectionPool.CheckOut()
at FirebirdSql.Data.Firebird.FbConnection.Open()
at Firebird.Form1.Form1_Load(Object sender, EventArgs e) in C:\Documents and Settings\amc-info.AVTOMOTOR\My Documents\Visual Studio Projects\Firebird\Form1.vb:line 75
|
| |
|
|
|