Showing posts with label form. Show all posts
Showing posts with label form. Show all posts

Monday, March 26, 2012

odbc datagrida

Good Day,
I got a table with company details.I am using ODBC to conect to it.

I am writing a windows form application in C# 2005 express edition.The task is to search companies. my code is as below.


OdbcCommand cmd = new OdbcCommand("use company", MyConnection);

cmd.CommandText = "SELECT * FROM employee WHERE Name = ?;"; /****line 3*****/
cmd.Parameters.Add("@.Name", OdbcType.VarChar, 30);
cmd.Parameters["@.Name"].Value = textBox1.Text;
cmd.ExecuteNonQuery();

OdbcDataAdapter datadapter = new OdbcDataAdapter(cmd.CommandText, MyConnection);
DataSet dataset = new DataSet();
datadapter.Fill(dataset,"employee"); /**error line***/

dataGridView1.DataMember="employee";
dataGridView1.DataSource=dataset;


The

above code compiles cleanly but when you run it,it gives a error. the

error statemnet is as below and the line giving error is show above in

coment.


ERROR [07002] [MySQL][ODBC 3.51 Driver][mysqld-5.0.27-community-nt]SQLBindParameter not used for all parameters


When line 3 is replaced by cmd.CommandText = "SELECT * FROM employee;"; the program works. fine.

I can view all employees only.BUT not a specific employee.
the problem looks complex.If some-one can help me out,it would be much appreciated.

Thanx
Rahul SK

msn add:ar_kul@.hotmail.comDo you sure that 'Name' field is exists in this table?

odbc datagrida

Good Day,
I got a table with company details.I am using ODBC to conect to it.

I am writing a windows form application in C# 2005 express edition.The task is to search companies. my code is as below.


OdbcCommand cmd = new OdbcCommand("use company", MyConnection);

cmd.CommandText = "SELECT * FROM employee WHERE Name = ?;"; /****line 3*****/
cmd.Parameters.Add("@.Name", OdbcType.VarChar, 30);
cmd.Parameters["@.Name"].Value = textBox1.Text;
cmd.ExecuteNonQuery();

OdbcDataAdapter datadapter = new OdbcDataAdapter(cmd.CommandText, MyConnection);
DataSet dataset = new DataSet();
datadapter.Fill(dataset,"employee"); /**error line***/

dataGridView1.DataMember="employee";
dataGridView1.DataSource=dataset;


The above code compiles cleanly but when you run it,it gives a error. the error statemnet is as below and the line giving error is show above in coment.

ERROR [07002] [MySQL][ODBC 3.51 Driver][mysqld-5.0.27-community-nt]SQLBindParameter not used for all parameters


When line 3 is replaced by cmd.CommandText = "SELECT * FROM employee;"; the program works. fine.

I can view all employees only.BUT not a specific employee.
the problem looks complex.If some-one can help me out,it would be much appreciated.

Thanx
Rahul SK

msn add:ar_kul@.hotmail.comDo you sure that 'Name' field is exists in this table?
sql

Friday, March 9, 2012

ODBC

I am extracting data from SQL Server to another data form, and i have a tabl
e which is of 5 GB , when ODBC reads the table a error comes "failed to crea
te recordset from table".
Can someone suggest what might be the reason, 1 reason i found was that the
jet.temp it creates in windows has a limit of 2 GB..
can anyone tell something to do this.
From http://www.developmentnow.com/g/111...server-odbc.htm
Posted via DevelopmentNow.com Groups
http://www.developmentnow.comI don't completely understand what the scenario is here but I'll take a stab
at it. I'm assuming that your getting this error somewhere in the middle of
the export. If your extracting data from Sql Server to a Jet database
(Microsoft.Jet.OLEDB.4.0 provider) then the problem most likely is the size
of your Sql table. .TMP files are used for processing Jet transactions and
are limited to the max Jet database size, which is 2gb. Even if you exporte
d
the Sql data to a text file first, if the data exceeds 2gb, it would still b
e
too much data for a Jet database.
--
-Curtis
"Anshul Kumar" wrote:

> I am extracting data from SQL Server to another data form, and i have a ta
ble which is of 5 GB , when ODBC reads the table a error comes "failed to cr
eate recordset from table".
> Can someone suggest what might be the reason, 1 reason i found was that th
e jet.temp it creates in windows has a limit of 2 GB..
> can anyone tell something to do this.
> From http://www.developmentnow.com/g/111...server-odbc.htm
> Posted via DevelopmentNow.com Groups
> http://www.developmentnow.com
>

ODBC

I am extracting data from SQL Server to another data form, and i have a table which is of 5 GB , when ODBC reads the table a error comes "failed to create recordset from table".
Can someone suggest what might be the reason, 1 reason i found was that the jet.temp it creates in windows has a limit of 2 GB..
can anyone tell something to do this.
From http://www.developmentnow.com/g/111_0_0_0_0_0/sql-server-odbc.htm
Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
I don't completely understand what the scenario is here but I'll take a stab
at it. I'm assuming that your getting this error somewhere in the middle of
the export. If your extracting data from Sql Server to a Jet database
(Microsoft.Jet.OLEDB.4.0 provider) then the problem most likely is the size
of your Sql table. .TMP files are used for processing Jet transactions and
are limited to the max Jet database size, which is 2gb. Even if you exported
the Sql data to a text file first, if the data exceeds 2gb, it would still be
too much data for a Jet database.
-Curtis
"Anshul Kumar" wrote:

> I am extracting data from SQL Server to another data form, and i have a table which is of 5 GB , when ODBC reads the table a error comes "failed to create recordset from table".
> Can someone suggest what might be the reason, 1 reason i found was that the jet.temp it creates in windows has a limit of 2 GB..
> can anyone tell something to do this.
> From http://www.developmentnow.com/g/111_0_0_0_0_0/sql-server-odbc.htm
> Posted via DevelopmentNow.com Groups
> http://www.developmentnow.com
>