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
Deepak Ratan
NA
175
50.8k
Getting Error in fileupload
May 18 2015 8:07 AM
protected void signout_Click(object sender, EventArgs e)
{
string photo;
string path;
if (Fileuploadprofilepick.PostedFile.ContentLength > 0)
{
photo = path.
GetFileName
(Fileuploadprofilepick.FileName);
path = Server.MapPath("images") + "/" + photo;
Fileuploadprofilepick.SaveAs(path);
}
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connect"].ConnectionString);
string query = "INSERT INTO TBL_PBLogin (UName,Password,photo) VALUES (@UName,@Password,@photo)";
try
{
con.Open();
SqlCommand cmd = new SqlCommand(query, con);
cmd.Parameters.Add("@UName", txtUname.Text);
cmd.Parameters.Add("@Password", txtUpassword.Text);
cmd.Parameters.Add("@photo",photo);
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();
con.Close();
ClearControl();
}
catch (Exception ex)
{
throw new Exception(ex.ToString());
}
}
ERROR:
Error 3 'string' does not contain a definition for 'GetFileName' and no extension method 'GetFileName' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)
Reply
Answers (
8
)
mvc
How to Design This Style of Menu !!!