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
Kevin Yu
NA
1
0
Pass Data from sql Database to DataTable
Mar 30 2006 9:24 AM
Hi All,
I am using VC++ 2005 Express and SQL Server express. The database MyDB has shown in the Data Sources panel after applying "add new data source" steps. In the MYDB, there is a table called "MyTable", which is also shown in Data Sources panel. How do I transfer data from MyTable to a DataTable ("dtTable")? I tried following codes but it didn't work.
SqlDataAdapter^ sqlAdapter;
DataTable^ dtTable;
sqlAdapter = gcnew sqlDataAdapter("select * from MyTable", "MyDB");
dtTable = gcnew DataTable("dtTable");
sqlAdapter->Fill(dtTable);
Any suggestions? Thanks in advance.
Kevin
Reply
Answers (
0
)
Build Settings in Visual C++ 2005 Express Edition
ActiveX control