16,013,642 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 .NET 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 Member 10599847 (Top 10 by date)
Member 10599847
1-Jun-14 7:58am
View
Here is the complete code
protected void btnUpload_Click(object sender, EventArgs e)
{
try
{
if (UploadExp.HasFile)
{
string path = UploadExp.FileName;
UploadExp.SaveAs(Server.MapPath(".\\Uploadfiles\\" + path));
OleDbConnection oconn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath(".\\UploadFiles\\" + path) + ";Extended Properties=Excel 8.0");
oconn.Open();
OleDbCommand ocmd = new OleDbCommand("Select * from [Sheet1$]", oconn);
OleDbDataAdapter odap = new OleDbDataAdapter(ocmd);
dl.sqldset = new DataSet();
odap.Fill(dl.sqldset);
GridView1.DataSource = dl.sqldset;
GridView1.DataBind();
oconn.Close();
}
else
{
string msg = "<script language='javascript'> alert(' Please Select a file ')</script>";
Page.RegisterStartupScript("popup", msg);
return;
}
}
catch (Exception ex)
{
string Err = "<script language='javascript'> alert(' " + ex.Message + "')</script>";
Page.RegisterStartupScript("popup", Err);
return;
}
}
Member 10599847
1-Jun-14 7:56am
View
I am not sure if I have understood your comments fully. Still I will try to explain the situation, hopefully you can find the difference. The application is developed in my local system, which means all the programs and relevant folders (in this case 'UploadFiles') are located in my local hard disk. But it points to the database in our remote server. When I run the application in a debugging mode or otherwise (i.e. by clicking View in Browser) with the same codes, the gridview is populated with the data in the excel sheet. But after the application is deployed into a dedicated database server when me or any other user logs on to the application from the browser, this particular module fails to work. I may mention here that the application was earlier located in a different server and the same code was working fine. Recently it has been moved to a new server with a different IP address. I don't know if I have made it clear to you
Member 10599847
1-Jun-14 7:01am
View
Try-catch block is already there, it does not display any error message
Member 10599847
1-Jun-14 6:30am
View
In the first place, gridview is not populated. Secondly, i tried to display a message before and after the 'oconn.open'. The message after the command is not displayed. Hence it is evident, for some reason the programs gets terminated at this line. If i run the same code from programming environment (my PC) instead of the server, it gets executed.
Member 10599847
30-Mar-14 2:11am
View
on page load event I did manage that. As suggested I am binding data on every event, it works. Thanks.
Member 10599847
27-Mar-14 11:12am
View
Here is the code:
protected void btnSubmit_Click(object sender, EventArgs e)
{
try
{
if (GridView1.Rows.Count != 0)
{
for (int i = 0; i < GridView1.Rows.Count; i++)
{
for (int x = 0; x < GridView1.Columns.Count; x ++)
{
if (x == 2)
{
TextBox tb1 = (TextBox)GridView1.Rows[i].FindControl("txtIntDt");
txtdt = tb1.Text.ToString();
}
else if (x == 4)
{
TextBox tb2 = (TextBox)GridView1.Rows[i].FindControl("txtITDt");
txtdt = tb2.Text.ToString();
}
else if (x == 6)
{
TextBox tb3 = (TextBox)GridView1.Rows[i].FindControl("txtBimsDt");
txtdt = tb3.Text.ToString();
}
else if (x == 8)
{
TextBox tb4 = (TextBox)GridView1.Rows[i].FindControl("txtQMDt");
txtdt = tb4.Text.ToString()
;
}
else if (x == 10)
{
TextBox tb5 = (TextBox)GridView1.Rows[i].FindControl("txt5Dt");
txtdt = tb5.Text.ToString();
}
else if (x == 12)
{
TextBox tb6 = (TextBox)GridView1.Rows[i].FindControl("txt6Dt");
txtdt = tb6.Text.ToString();
}
else if (x == 14)
{
TextBox tb7 = (TextBox)GridView1.Rows[i].FindControl("txtTTDt");
txtdt = tb7.Text.ToString();
}
if (txtdt != "")
{
----here i am updating the tables, but not happening because the value is always null---
}
}
}
Member 10599847
9-Mar-14 3:38am
View
I did that in command window in Visual Studio 2008 only It has a list of commands, but it does not contain this command. It has a command 'build.cleansolution', but it says this command is not available.
Member 10599847
9-Mar-14 2:01am
View
When I type devenv in the command window, it throws an error, "Command devenv is invalid". Please advise what could be the alternative.
Thanks
Member 10599847
20-Feb-14 0:30am
View
Thanks Sampath. I can't find 'clean' option in Visual Studio 2008. A simple rebuild does not solve the problem. Rebuild still fails. But as I said, program runs correctly. Kindly advise]
Member 10599847
16-Feb-14 3:17am
View
Thanks Guys,
I can't find 'clean' option in Visual Studio 2008. A rebuild does not solve the problem. Rebuild still fails.
Thanks
Raj
Show More