Hey.. =)
I am making a program and i need to use:
using System.Data.ADO
But it won't work?
Anybody know what i can do?
Hey.. =)
I am making a program and i need to use:
using System.Data.ADO
But it won't work?
Anybody know what i can do?
ADO.NET includes two categories of classes.
1. Relational classes (DataSet) : These classes used independently of .net data provider (database classes) to manage data local to the application. Relational classes are found at the System.Data namespace.
2. Data-Provider classes : Data-Provider classes are for connecting database, executing queries (commands), and retrieving results.
If you are planing to programming with MS-SQL server database then choose System.Data.SqlClient namespace classes.
using System;
using System.Data;
using System.Data.SqlClient;
public class Sample {
}
I would change if i could, but i can't find out how to save new records. I have asked in this thread for some help to that:
http://www.daniweb.com/forums/thread267593.html
But i have found an example of how to save new records to my database but i need to use data.ADO
This is the sample i am trying at the moment:
http://www.codeproject.com/KB/database/simpledbreadwrite.aspx
If you have any idea how i can save a new record then please, please tell me.. I really need it. =)
System.Data.ADO does not exist. The article you linked to was written in 2001 when .NET was still in beta. The final release and subsequent releases use objects in other namespaces.
As adatapost said, you should use objects within a namespace that is specific to your database connection type.
If you are using SQL Server, it would be System.Data.SqlClient, and you would look at objects such as SqlConnection, SqlCommand, SqlDataAdapter, etc.
If you are using an OLEDB database such as Microsoft Access, you would use System.Data.OleDb and objects such as OleDbConnection, OleDbCommand, and OleDbDataAdapter.
ODBC => System.Data.Odbc => OdbcConnection, OdbcCommand, OdbcDataAdapter, etc.
The objects inherit from common base classes (DbConnection, DbCommand, DbDataAdapter, etc.) and behave in the same way, but the implementation details are optimized for the given connection type. Do research on the family of objects that best meet the needs for your given database.
I am using an sql db.
Thanks for the answer.
You can try to help me in my other thread if you want. =)
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.