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
mahmud_uk
NA
48
0
Fill DataGrid using SQL + C#
Jul 22 2004 9:20 AM
Hi i'm trying to fill my datagrid with databse field which i retrived using SQl, but its not functioning. Can anyone look at it and see where it went wrong. Thanks private void Form2_Load(object sender, System.EventArgs e) { SqlConnection da = new SqlConnection( @"Data Source= xxx.xxx.xxx.xxx;"+ "Initial Catalog = drmTest;" + "Network Library=DBMSSOCN;"+ "user id =xxxxxx;"+ "Password=xxxxxx"); da.Open(); SqlCommand thisCommand = da.CreateCommand(); thisCommand.CommandText = "SELECT * FROM License"; Object countResult = thisCommand.ExecuteScalar(); DataSet ds = new DataSet(); da.Fill(ds, "License"); dataGrid1.DataSource = ds.Tables["License"].DefaultView ; da.Close(); }
Reply
Answers (
5
)
Insert a null value in a table
SQL PLUS COMMAN .SQL FILE .NET