15,886,919 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 EasyHero (Top 59 by date)
EasyHero
23-Oct-18 23:44pm
View
Here's the error after updating my code as you suggested "An error occurred while sending the request. Unable to connect to the remote server A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 23.38.53.172:80 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)"
EasyHero
23-Oct-18 8:17am
View
Yes, i have opened the url on the browser and it returns an xml just as expected
EasyHero
7-Mar-18 5:18am
View
Hi, I just tried this, it didn't work
EasyHero
6-Mar-18 10:24am
View
From my question, what i want to achieve is this, as the ViewPagerAdapter changes to a new fragment, i want a new theme set for the parent. calling the setTheme() before the setContentView() would only set the theme once for the activity
EasyHero
6-Mar-18 10:22am
View
That for the fragments yeah?
EasyHero
6-Mar-18 10:07am
View
i'm aware this would work as i stated in my question. But my challenge here is that, the activity doesn't get recreated when switching between fragment views. Hence i would have been able to do this
EasyHero
10-Oct-17 14:18pm
View
Thanks a lot. I have a lot of studying to do then
EasyHero
17-Aug-16 13:55pm
View
i think the syntax is wrong. even after adding the $ sign, it didn't work.
EasyHero
27-May-16 9:30am
View
Sir, your explanation pointed me out to where d problem was and not necessarily solving it. It's still not working even though I know where d problem is
EasyHero
27-May-16 4:07am
View
Still giving same error
EasyHero
27-May-16 4:07am
View
Yes ad1file is null. Dunno y
EasyHero
26-May-16 18:38pm
View
sorry it's thrown on the "foreach" line in the controller action
EasyHero
26-May-16 18:36pm
View
sorry it's thrown on the "foreach" line in the controller action
EasyHero
25-May-16 14:22pm
View
this is how i've called the function on successful submission of the form
<pre>@using (Ajax.BeginForm("submitSchlAd1", "Ministry", new AjaxOptions { HttpMethod = "POST", OnSuccess = "showSuccess('@Model.returnedxml1')", OnFailure = "showFail('@Model.returnedxml1')" }, new { @id = "schlregdiv", @class = "form-horizontal" }))</pre> stil it isn't returning serverside information.
EasyHero
5-Apr-16 16:07pm
View
perfect answer. Thanks for the reference
EasyHero
5-Apr-16 15:05pm
View
how do i do that? don't have an idea.
EasyHero
5-Apr-16 3:26am
View
this is exactly what i'm trying to achieve, i have bootstrap.css, bootstrap.min.css, jquery-2.2.1.js, jquery-2.2.1.min.js, bootstrap.js, bootstrap.min.js referenced. i dunno why it isn't working.
here's my layout page
<pre lang="c#">
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>@ViewBag.Title</title>
@Styles.Render("~/Content/css")
</head>
<body class="body-min">
<div>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 navoffset navbar-fixed-top">
<ul class="nav nav-tabs">
<li class="colour active">@Html.ActionLink("Staffs", "addStaff", "SchlAdmin")</li>
<li class="colour" data-toggle="tab">@Html.ActionLink("Students", "addStudent", "SchlAdmin")</li>
<li class="colour" data-toggle="tab">@Html.ActionLink("Incidents", "staffInc", "SchlAdmin")</li>
<li class="colour" data-toggle="tab">@Html.ActionLink("Admin", "addasset", "SchlAdmin")</li>
<li class="colour" data-toggle="tab">@Html.ActionLink("Search", "staffSearch", "SchlAdmin")</li>
<li class="colour" data-toggle="tab">@Html.ActionLink("Profile", "prof", "SchlAdmin")</li>
</ul>
</div>
@RenderBody()
<div class="footertag-min"><p>© @DateTime.Now.Year - NSMS</p></div>
</div>
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jqueryval")
@Scripts.Render("~/bundles/bootstrap")
</body>
</html>
</pre>
and here's my bundle class
<pre lang="c#">
public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-*", "~/Scripts/Ministries.js", "~/Scripts/schladmin1.js", "~/Scripts/jquery-{version}.js", "~/Scripts/jquery.unobtrusive-ajax.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include("~/Scripts/jquery.validate*"));
bundles.Add(new ScriptBundle("~/bundles/angular").Include("~/Scripts/angular.js", "~/Scripts/angular-*"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include("~/Scripts/bootstrap.js", "~/Scripts/respond.js"));
bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/bootstrap.css"));
}
}
</pre>
EasyHero
5-Apr-16 3:17am
View
this is exactly what i'm trying to achieve. i have bootstrap.css, bootstrap.min.css, bootstrap.js, bootstrap.min.js, jquery-2.2.1.js and jquery-2.2.1.min.js referenced, so i dunno why it isn't working.
EasyHero
5-Apr-16 3:06am
View
the links worked but the first link remains in the active state(i.e. shows the active css style) while i'm in another page. what i want to achieve is for the current page to show the active style
EasyHero
4-Apr-16 7:15am
View
the styling for active is working, what's not working is the navigation to the page (which is to the function that calls the view) but once i remove the data-toggle attribute, the navigation works and css active doesn't
EasyHero
2-Apr-16 15:28pm
View
same thing, dunno y its like this in my app
EasyHero
2-Apr-16 14:56pm
View
still can't navigate to the various pages bt if i remove the data-toggle attribute, i would be able to
EasyHero
22-Jan-16 12:13pm
View
Thanks, it worked
EasyHero
21-Jan-16 16:13pm
View
that path isn't loading up the image, or am i missing something?
EasyHero
21-Jan-16 15:58pm
View
Request.Files["ad1file"] gives me the name of the file e.g. image1.jpg. Path.GetFullPath(path) gives me the absolute path e.g. C:\Program Files (x86)\IIS Express\166875_172708726105688_7981605_n.jpg. but i need the actual path e.g. C:\Users\name\Pictures\image1.jpg
EasyHero
21-Jan-16 15:13pm
View
no, the file isn't there. its in another location
EasyHero
21-Jan-16 15:07pm
View
Path.GetFullPath(path) returns this C:\Program Files (x86)\IIS Express\166875_172708726105688_7981605_n.jpg which is the absolute path. the absolute path when passed to the model doesn't bring up the image
i can't seem to get File.Exist(path). i'm using MVC5
EasyHero
21-Jan-16 14:53pm
View
i'm just asking if i can be assisted with how i can point to the file, because Path.GetFullPath() doesn't give me the actual file location
EasyHero
21-Jan-16 14:47pm
View
yes, its returning the absolute path. still doesn't show the image in the <img/>
it returns this C:\Program Files (x86)\IIS Express\166875_172708726105688_7981605_n.jpg which isn't the location of the image on my harddrive
EasyHero
21-Jan-16 14:32pm
View
path contains the file name. string path = Request.Files["ad1file"].FileName; its d first line of my controller function
EasyHero
19-Jan-16 8:28am
View
I'm retrieving the selected text of a dropdown list into var 'staname' in the onchange event of the dropdown . Still in that on change event, I want the value of var 'staname' which is the text to be assigned to a model property. That's what I'm trying to achieve.
EasyHero
19-Jan-16 7:55am
View
Not still mapping the value. I don't understand why "MP" is in the data statement of the Ajax query and "StateName" is in the httppost method.
EasyHero
18-Jan-16 8:14am
View
I have errors on this line (SelectList)Model => Model.Name, null, new
Error that says something like "cannot convert Models.Category to System.Web.Mvc.SelectList"
Category is a class in my models and it contains a generic list called Name
EasyHero
15-Jan-16 1:45am
View
are the function parameters index and element keywords or are they supposed to mean something in my code
EasyHero
15-Jan-16 1:37am
View
its hitting and displaying the correct result from the controller code. the problem is from the javascript
i'm not very good in javascript so I don't know what to do there
EasyHero
12-Jan-16 13:34pm
View
I tried this but it didn't work, still not returning anything but if I run my controller function, it returns what I need in a generic list in json format
EasyHero
10-Jan-16 2:49am
View
pls how do I do that?
EasyHero
23-Sep-15 16:28pm
View
no, its not, take note of the difference in the loops. in my question i have a parent foreach loop nesting two for loops but in my solution i have the foreach loop being nested by the first for loop
EasyHero
23-Sep-15 16:27pm
View
i just forgot to remove that comment
EasyHero
23-Sep-15 16:10pm
View
It worked for me perfectly without issuing the error.
EasyHero
20-Sep-15 7:34am
View
Thanks a lot, I it worked perfectly, I'm sorry for my comment earlier, it lacked a thorough study background. I found applied your solution and it worked. I'll post the solution I found later for others too. Thanks
EasyHero
20-Sep-15 7:13am
View
I've just tried changing the second parameter in the for loop to k < excel.Cells .Count but I got an error. I'm using visual studio 2013 which runs a .NET framework 4.5. I dunno what or why I'm getting d error if gridview has a Cells.Count property
EasyHero
10-Sep-15 7:55am
View
no problem. Thanks, you still enlightened me
EasyHero
10-Sep-15 7:22am
View
i have some observations and possibly questions on line 3 of your code. the mysqlcommand name is cmd2 and in my code i changed the SqlParameter and SqlDbType to that of MySql each. apart from those, i have exactly same code in same position as yours but i'm not still getting any values
EasyHero
10-Sep-15 6:32am
View
This worked for only the first item in the loop. didn't work for the remaining. it issued an "Parameter @code already defined" error
EasyHero
4-Aug-15 1:09am
View
thanks
EasyHero
4-Aug-15 1:08am
View
thanks
EasyHero
11-Jul-15 9:59am
View
syntax error
cannot apply indexing with [] to an expression of type 'System.Web.UI.WebControls.Gridview'
EasyHero
11-Jul-15 7:11am
View
this is what i keep getting in the first row of my database( for each column) the code i use below isn't getting the values of the rows, else it gets these
System.Web.UI.W, System.Web.UI.WebControls.Grid, System.Web.UI.W System.Web.UI.WebControls, System.Web.UI.WebControls.GridViewR, System.Web.UI.WebControls.GridViewRow
here is the code i'm using now
MySqlConnection conn = new MySqlConnection(connection);
MySqlCommand com = new MySqlCommand("insert into pla20132014.admissions (jambNo, Names, state, lga, course, department) values (@jambno, @name, @state, @lga, @course, @dept)", conn);
conn.Open();
//int rowcounter = 0;
foreach (TableRow td in excel.Rows)
{
com.Parameters.Add("@jambno", MySqlDbType.VarChar).Value = excel.Rows.ToString();
com.Parameters.Add("@name", MySqlDbType.VarChar).Value = excel.Rows.ToString();
com.Parameters.Add("@state", MySqlDbType.VarChar).Value = excel.Rows[2];
com.Parameters.Add("@lga", MySqlDbType.VarChar).Value = excel.Rows[3];
com.Parameters.Add("@course", MySqlDbType.VarChar).Value = excel.Rows[4];
com.Parameters.Add("@dept", MySqlDbType.VarChar).Value = excel.Rows[5];
com.ExecuteNonQuery();
}
conn.Close();
is that the way u said i should loop it?
EasyHero
11-Jul-15 7:10am
View
please what is d function of the [rowcounter]?
also, this is what i keep getting in the first row of my database( for each column) the code i use below isn't getting the values of the rows, else it gets these
System.Web.UI.W System.Web.UI.WebControls.Grid System.Web.UI.W System.Web.UI.WebControls System.Web.UI.WebControls.GridViewR System.Web.UI.WebControls.GridViewRow
here is the code i'm using now
MySqlConnection conn = new MySqlConnection(connection);
MySqlCommand com = new MySqlCommand("insert into pla20132014.admissions (jambNo, Names, state, lga, course, department) values (@jambno, @name, @state, @lga, @course, @dept)", conn);
conn.Open();
//int rowcounter = 0;
foreach (TableRow td in excel.Rows)
{
com.Parameters.Add("@jambno", MySqlDbType.VarChar).Value = excel.Rows.ToString();
com.Parameters.Add("@name", MySqlDbType.VarChar).Value = excel.Rows.ToString();
com.Parameters.Add("@state", MySqlDbType.VarChar).Value = excel.Rows[2];
com.Parameters.Add("@lga", MySqlDbType.VarChar).Value = excel.Rows[3];
com.Parameters.Add("@course", MySqlDbType.VarChar).Value = excel.Rows[4];
com.Parameters.Add("@dept", MySqlDbType.VarChar).Value = excel.Rows[5];
com.ExecuteNonQuery();
}
conn.Close();
EasyHero
11-Jul-15 2:25am
View
no error message, it doesn't insert the row data into the mysql table
EasyHero
28-Feb-15 3:28am
View
The images re compressed inside an image box of size 150x150. Irrespective of d image size. Could that be the problem?
EasyHero
3-Feb-15 16:23pm
View
Thanks man, this worked. i used the IndexOf method to search for d char ',' then i used the remove method to remove all characters from that position till the end of the string.
reading was an eye opener. was looking in the wrong places earlier. was actually looking for solution amongst the methods of textbox class
EasyHero
3-Feb-15 5:27am
View
you have to describe exactly what you want to achieve and place sample code for further illustration
EasyHero
14-Dec-14 2:03am
View
Thanks guys. It helped a lot
EasyHero
8-Oct-14 16:15pm
View
still not getting d desired result. i changed my code for saving into the database into the code below, it didn't give me any error but it didnot upload a file to the database i.e. the size of file in my database is zero
byte[] passport1 = null;
Stream fs1 = FileUpload1.PostedFile.InputStream;
BinaryReader br1 = new BinaryReader(fs1);
passport1 = br1.ReadBytes((Int32)fs1.Length);
EasyHero
30-Sep-14 16:29pm
View
can my location (nigeria) be a determining factor for this error?
EasyHero
30-Sep-14 16:24pm
View
i still get this set of errors;
Message: Error in processing. The server response was: Request action aborted on MFE proxy, SMTP server is not available.
Source: System.
Stack Trace: at System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint) at System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) at WLCFoleh.contact.submitmsg_Click(Object sender, EventArgs e) in C:\Users\israel asha\Documents\Visual Studio 2010\Projects\WLCFoleh\WLCFoleh\contact.aspx.cs:line 55
line 55 being sc.Send(msf);
EasyHero
30-Sep-14 3:14am
View
I just tried the code and I get these errors as sent by the exception.message, exception.source
Message: Error in processing.
Source: System
and stack trace said I had an error at this line of code
smtpClient.Send(mail)
Show More