Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 18th, 2005, 10:25 AM
Smoke Smoke is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 4 Smoke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Troubles with .net data adapter v1.7

frameworks 1.1
studio 2003

my connect string:

FbConnectionStringBuilder cs = new FbConnectionStringBuilder();

cs.DataSource = "localhost";
cs.Database = "b1.gdb";
cs.UserID = "SYSDBA";
cs.Password = "masterkey";
cs.Dialect = 3;
cs.ConnectionLifeTime=0;
cs.Charset="WIN1251";
cs.ConnectionTimeout=30;
cs.PacketSize=8192;
cs.ServerType=3;
cs.Pooling=false;
cs.FetchSize=20;
cs.Port=3050;
string connectionString = cs.ToString();
----------------------------------------------------------
gives error:An invalid connection string argument has been supplied or a required connection string argument has not been supplied.
-----------------------------------------------------------
code:

string connectionString = "User=SYSDBA;" + "Password=masterkey;" + "Database=b1.gbd;" + "DataSource=localhost;" + "Port=3050;" + "Dialect=3;" + "Charset=WIN1251;" + "Role=;" + "Connection lifetime=15;" + "Pooling=true;" + "MinPoolSize=0;" + "MaxPoolSize=50;" + "Packet Size=8192;" + "ServerType=0";
----------------------------------------------------------
Invalid PInvoke metadata format.

what can I do?

P.S. Можно и по-русски

Reply With Quote
  #2  
Old January 19th, 2005, 05:05 AM
fikret fikret is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Sarajevo, Bosnia
Posts: 111 fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 5 h 17 m 43 sec
Reputation Power: 8
Connection string for connecting to Firebird in .NET applications:
“User=SYSDBA;Password=masterkey; Database=SampleDatabase.fdb; DataSource=localhost; Port=3050;Dialect=3;Charset=NONE;Role=; Connection lifetime=15;Pooling=true;MinPoolSize=0;MaxPoolSize=50;Packet Size=8192;ServerType=0″

Database connection strings

--
Best regards,
Fikret Hasovic http://fikret.fbtalk.net

FirebirdSQL Foundation member.
- Join today at http://www.firebirdsql.org/ff/foundation
JEDI VCS contributor
http://jedivcs.sourceforge.net/

Reply With Quote
  #3  
Old January 19th, 2005, 05:13 AM
fikret fikret is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Sarajevo, Bosnia
Posts: 111 fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 5 h 17 m 43 sec
Reputation Power: 8
Or try this piece of code:

using System;
using System.Data;
using FirebirdSql.Data.Firebird;

public class Test
{
public static void Main(string[] args)
{
string connectionString =
"Database=C:PROGRAM FILESFIREBIRDEXAMPLESEMPLOYEE.GDB;" +
"User=SYSDBA;" +
"Password=masterkey;" +
"Dialect=3;" +
"Server=localhost";


IDbConnection dbcon = new FbConnection(connectionString);
dbcon.Open();
IDbCommand dbcmd = dbcon.CreateCommand();
string sql = "SELECT * FROM employee";
dbcmd.CommandText = sql;
IDataReader reader = dbcmd.ExecuteReader();
while(reader.Read()) {
object dataValue = reader.GetValue(0);
string sValue = dataValue.ToString();
Console.WriteLine("Value: " + sValue);
}
// clean up
reader.Close();
reader = null;
dbcmd.Dispose();
dbcmd = null;
dbcon.Close();
dbcon = null;
}
}



--
Best regards,
Fikret Hasovic http://fikret.fbtalk.net

FirebirdSQL Foundation member.
- Join today at http://www.firebirdsql.org/ff/foundation
JEDI VCS contributor
http://jedivcs.sourceforge.net/

Reply With Quote
  #4  
Old January 19th, 2005, 08:52 AM
Smoke Smoke is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 4 Smoke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
it didn't help...I don't know what to do...

it still writes: @Invalid PInvoke metadata format."

Reply With Quote
  #5  
Old January 24th, 2005, 04:19 AM
Smoke Smoke is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 4 Smoke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
up

Reply With Quote
  #6  
Old January 24th, 2005, 10:14 AM
Smoke Smoke is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 4 Smoke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
here is my test code

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using FirebirdSql.Data.Firebird;

namespace WindowsApplication2
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.TreeView treeView1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.RichTextBox richTextBox1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;

public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#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>
private void InitializeComponent()
{
this.treeView1 = new System.Windows.Forms.TreeView();
this.textBox1 = new System.Windows.Forms.TextBox();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.SuspendLayout();
//
// treeView1
//
this.treeView1.ImageIndex = -1;
this.treeView1.Location = new System.Drawing.Point(8, 0);
this.treeView1.Name = "treeView1";
this.treeView1.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
new System.Windows.Forms.TreeNode("Node0", new System.Windows.Forms.TreeNode[] {
new System.Windows.Forms.TreeNode("Node5", new System.Windows.Forms.TreeNode[] {
new System.Windows.Forms.TreeNode("Node6", new System.Windows.Forms.TreeNode[] {
new System.Windows.Forms.TreeNode("Node7")}),
new System.Windows.Forms.TreeNode("Node12", new System.Windows.Forms.TreeNode[] {
new System.Windows.Forms.TreeNode("Node13")})})}),
new System.Windows.Forms.TreeNode("Node1", new System.Windows.Forms.TreeNode[] {
new System.Windows.Forms.TreeNode("Node8", new System.Windows.Forms.TreeNode[] {
new System.Windows.Forms.TreeNode("Node9", new System.Windows.Forms.TreeNode[] {
new System.Windows.Forms.TreeNode("Node10", new System.Windows.Forms.TreeNode[] {
new System.Windows.Forms.TreeNode("Node11")})})})}),
new System.Windows.Forms.TreeNode("Node2"),
new System.Windows.Forms.TreeNode("Node3"),
new System.Windows.Forms.TreeNode("Node4")});
this.treeView1.SelectedImageIndex = -1;
this.treeView1.Size = new System.Drawing.Size(64, 264);
this.treeView1.TabIndex = 0;
this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(168, 8);
this.textBox1.Name = "textBox1";
this.textBox1.TabIndex = 1;
this.textBox1.Text = "textBox1";
//
// richTextBox1
//
this.richTextBox1.Location = new System.Drawing.Point(72, 40);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(216, 224);
this.richTextBox1.TabIndex = 2;
this.richTextBox1.Text = "richTextBox1";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.richTextBox1,
this.textBox1,
this.treeView1});
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);

}
#endregion

/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());





}

private void treeView1_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
{
this.textBox1.Text=this.treeView1.SelectedNode.Index.ToString();
}

private void Form1_Load(object sender, System.EventArgs e)
{
//
string connectionString =
"Database=D:\\FireBird\\X.GBD;" +
"User=SYSDBA;" +
"Password=masterkey;Pooling=false;" +
"Dialect=3;" +
"Server=localhost";


try
{
using (FbConnection dbcon = new FbConnection(connectionString))
{
dbcon.Open();
dbcon.Close();
richTextBox1.Text="FB";
}
}
catch (Exception e2)
{
string stack = e2.StackTrace.ToString();
richTextBox1.Text=stack;
}
//
//richTextBox1.Text=System.Net.OSSOCK.gethostbyname("localhost").ToString();

}
}
}

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Troubles with .net data adapter v1.7


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway