15,919,931 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by himanil (Top 1 by date)
himanil
16-Sep-17 9:26am
View
hi thanks for reply, Actually I need to implement following things:
1. The user can load any Excel File from which he want to add data on fields like Labels.
2. The Excel will be loaded into Dataset and Dataset will be loaded in DataGridview. So he can see his Excel file.
3. User can then type the Column names in textboxes from which he needed Information to be added on Form, This will facilitate to add specific Columns information not all the colums because in one Excel sheet he can have 5 columns useful and in other Excel he might have 10 Columns useful only.
4. Whatever Column name he typed in Textboxes, The cells value will be added to corresponding Labels in Form. So this will like Choose which columns data you want to display and facilitate user in more friendly way.
I had implemented this process till Step 2 successfully but in next step if I try to define code for lets sake 15 Labels only. So what I did I wrote the above code 15 times changing only label and Textbox ids to map maximum 15 labels with 15 columns by 15 Textboxes.
But the problem I am facing is if I as a user at this time leaves any of the textbox as Blank which means I might have selected 9 columns then C# throws an error like, ' ' is not found in dataset.
I am figuring out how to solve this.
Hope this will make my situation clear and helps you or others to find a solution for this problem and I know Codeproject users can Code anything.
Thanks and Warm Regards