TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Natasha bronze
NA
1
0
Need Help to connet to postgres database on .net enviroment
Apr 15 2009 2:24 AM
Hi,
I am presently working on visual studio 2005, and my back end is postgres, now i need some help with ado.net. I need to put my postgres table in a data grid view using c# in a windows form? rite now iam trying npgsql to connect it with DB.. but iam not getting the rite outcome. here is the code which iam using.. could some one help me with this?
NpgsqlConnection conn = new NpgsqlConnection("Server=127.0.0.1;Port=5432; User ID= postgres; Password= postgres; database= postgres");
string query = "Select * from EMP";
NpgsqlCommand cmd = new NpgsqlCommand(query, conn);
NpgsqlDataAdapter da = new NpgsqlDataAdapter(query, conn);
//NpgsqlCommandBuilder cbuilder = new NpgsqlCommandBuilder(da);
DataTable dt = new DataTable();
DataSet ds = new DataSet();
da.Fill(dt);
DataGridView dg = new DataGridView();
dg.DataSource = dt;
Reply
Answers (
0
)
Filter Expression based on Multiple Conditions
Help with a project needed