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
Sanjeev Shrestha
NA
17
0
Getting TableName only from Northwind Database.....Can someone help
Jan 19 2007 4:15 PM
Hi,
I have a simple problem. All I need is a simple program that provides only tableName from Northwind Database.
What SQL Query should I write.
In the following code, I need to provide tableName (so that I can get DataSet object. I need to get a new tableName from
Northwind database at every iteration and pass the tableName to this method.
I need help.......
/****************************************/
private DataSet ReturnDataSet(tableName)
{
DataSet dataSet = null;
string sqlStatement = "select * from " + tableName;
try
{
using (SqlConnection sqlConnection = new SqlConnection(connectionInfo))
using (SqlCommand sqlCommand = new SqlCommand(sqlStatement, sqlConnection))
{
SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
dataSet = new DataSet();
sqlDataAdapter.Fill(dataSet, tableName);
}
}
catch
{
//Log the exception.
}
return dataSet;
}//End ReturnDataSet
Sanjeev
Reply
Answers (
1
)
Session timeout Problem.
I am having problems with showing data in tabular format