15,891,607 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 CP_vicky (Top 37 by date)
CP_vicky
16-Dec-14 1:19am
View
What i understand is if we want to add a new row into a table which consist of Foreign key that should not allow, we need to add in to the table first which consist of primary key. is it correct.
CP_vicky
12-Dec-14 3:43am
View
I am missing the Radio button selected values.
Now it is fine
Filter = "select a.SID as ProfileID,a.StaffName as Name,b.Designation,a.Staffqualification as Qualification,a.Uploadphoto as ImageUrl,case a.Status when '1' then 'Active' when '2' then 'InActive' end as Status,convert(varchar(12),a.date,101) as Date from Adding_New_Staff a join Dental_Designation b on a.StaffDesignation=b.Did where a.StaffDesignation='" + RbnFilter.SelectedValue + "' order by a.sid";
CP_vicky
10-Dec-14 5:05am
View
Thank you
CP_vicky
9-Dec-14 7:37am
View
Welcome bro.. See how crazy.. down voted some one's answer(if it really poor answer you can, but its a related answer know). you know the dot net by birth or what. any one can learn any thing. Sorry bro..Rohan Leuva
CP_vicky
9-Dec-14 6:45am
View
Instead of keep calm at least i shared what i know and i expect from him is if he understand single line also that will be good for me.. don't discourage some one sharing the knowledge to some one which he knows a bit also
CP_vicky
8-Dec-14 3:06am
View
Can u plz share the code
CP_vicky
8-Dec-14 2:10am
View
Thank you PIEBALDconsult
CP_vicky
8-Dec-14 2:03am
View
My goodness. Fantastic Tool and Answer. Thank you very much Raul Iloc
CP_vicky
8-Dec-14 1:53am
View
Thank you Praveen, but it is not working. what ever the special symbols i give that value is storing in the data base. How to give exception message here.
CP_vicky
8-Dec-14 1:48am
View
Deleted
"'" " " "" ":" What does it contains
CP_vicky
5-Dec-14 4:47am
View
Yes
CP_vicky
4-Dec-14 9:14am
View
I did. please have a look
CP_vicky
4-Dec-14 9:08am
View
Try this....
http://csharp.net-informations.com/file/dbtopdf.htm
CP_vicky
4-Dec-14 9:03am
View
<asp:GridView ID="Grdmilestones" runat="server" AutoGenerateColumns="False" OnRowCommand="Grdmilestones_RowCommand"
CssClass="Grid" PageSize="50" AllowPaging="True" AlternatingRowStyle-CssClass="alt"
PagerStyle-CssClass="pgr" Width="100%">
<HeaderStyle BackColor="#993333" CssClass="dgHeaderStyle" Font-Bold="True" Font-Italic="False"
Font-Overline="False" Font-Size="Medium" Font-Strikeout="False" Font-Underline="False" />
<alternatingrowstyle cssclass="alt">
<columns> <asp:TemplateField HeaderText="Milestone ID">
<itemtemplate>
<asp:Label ID="MsID" runat="server" Text='<%# Eval("MsID") %>'>
<asp:TemplateField HeaderText="Title">
<itemtemplate>
<asp:Label ID="Title" runat="server" Text='<%# Eval("Title") %>'>
<asp:TemplateField HeaderText="Description">
<itemtemplate>
<asp:Label ID="Description" runat="server" Text='<%# Eval("Description") %>'>
<asp:TemplateField>
<itemtemplate>
<asp:LinkButton ID="LinkView" runat="server" CommandName="Select" Text="View" OnClick="LinkView_Click">
<asp:TemplateField>
<itemtemplate>
<asp:HyperLink ID="HyperLinkEdit" runat="server" NavigateUrl='<%#"MilestonesDetails.aspx?ID="+Eval("MsID")%>'
Target="_blank" Text="Edit">
<asp:TemplateField>
<itemtemplate>
<asp:LinkButton ID="HyperLinkDelete" runat="server" Text="Delete" CommandArgument='<%# Eval("MsID") %>'
CommandName="Vdelete" OnClientClick="return ConfirmOnDelete('');" />
<</PagerStyle>
CP_vicky
4-Dec-14 4:54am
View
Can you please explain in step by step. its not working here
CP_vicky
4-Dec-14 4:18am
View
I am not having Text box to edit the fields. how to edit the Grid view fields on clicking edit link button
CP_vicky
4-Dec-14 3:11am
View
In Grid view i am having view and Edit Link buttons. If i press view a new Popup window has to generate and should display the Grid view values.
Same like Edit also but it can be edit and change will save in to data base
CP_vicky
4-Dec-14 0:15am
View
Problem Solved. I checked this as Accept Answer. Thank you very much.
CP_vicky
3-Dec-14 23:39pm
View
public partial class ImageUpLoader : System.Web.UI.Page
{
string sqlstr;
static string path;
string strFileName1;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
}
}
public void uploadDocument()
{
if ((FileUpload1.PostedFile != null))
{
HttpPostedFile file1 = FileUpload1.PostedFile;
path = /* "Documents/" + */ file1.FileName;
strFileName1 = Server.MapPath("~/Documents/") + file1.FileName;
file1.SaveAs(strFileName1);
string ext = Path.GetExtension(path);
string contenttype = String.Empty;
switch (ext)
{
case ".jpg":
contenttype = "image/jpg";
break;
case ".png":
contenttype = "image/png";
break;
case ".gif":
contenttype = "image/gif";
break;
case ".pdf":
contenttype = "image/pdf";
break;
}
}
}
protected void btnUpload_Click(object sender, EventArgs e)
{
uploadDocument();
string date = DateTime.Now.ToString("dd-MM-yyyy");
string imageid = DAL.getRunningID("4");
sqlstr = "insert into Images(ImageID,URL,DateTime)values(" + imageid + ",'" + path + "','" + date + "')";
string sqlUpdate = "update Fms_Autonumber set RNo='" + imageid + "' where RCode='4'";
List<string> ids = new List<string>();
ids.Add(sqlstr);
ids.Add(sqlUpdate);
int j = DAL.sqlTransaction(ids);
if (j > 0)
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "Successfully Inserted", "alert('Image Uploaded Successfully..!')", true);
}
mltImageurl.Text = strFileName1;
}
protected void Page_PreRender(object sender, EventArgs e)
{
ViewState["CheckRefresh"] = Session["CheckRefresh"];
}
}
Again it is inserting like same
CP_vicky
3-Dec-14 8:47am
View
Refresh the Page
CP_vicky
3-Dec-14 8:22am
View
Same image inserting
CP_vicky
3-Dec-14 8:04am
View
http://www.codeproject.com/Questions/849291/insert-query-executing-when-every-time-page-got-re?arn=0
CP_vicky
3-Dec-14 8:03am
View
Deleted
http://www.codeproject.com/Questions/849291/insert-query-executing-when-every-time-page-got-re?arn=0
CP_vicky
3-Dec-14 7:56am
View
I asked one question in the afternoon, till now that is not solved, can u please look at once.
Question is:
insert query executing when every time page got refreshing
CP_vicky
3-Dec-14 7:49am
View
I did, just check it.
CP_vicky
3-Dec-14 7:36am
View
I solved using your solution.
<asp:Button ID="btnUpload" runat="server" Text="Upload" CssClass="style3" Height="26px"
Width="100px" OnClick="btnUpload_Click" ValidationGroup="btnUpload"/>
CP_vicky
3-Dec-14 7:30am
View
ya solved
CP_vicky
3-Dec-14 7:29am
View
problem solved.. thank u all
CP_vicky
3-Dec-14 7:27am
View
no
CP_vicky
3-Dec-14 7:12am
View
Thank you. got it
CP_vicky
3-Dec-14 7:09am
View
protected void btnUpload_Click(object sender, EventArgs e)
{
uploadDocument();
string date = DateTime.Now.ToString("dd-MM-yyyy");
string imageid = DAL.getRunningID("4");
sqlstr = "insert into Images(ImageID,URL,DateTime)values(" + imageid + ",'" + path + "','" + date + "')";
string sqlUpdate = "update Fms_Autonumber set RNo='" + imageid + "' where RCode='4'";
List<string> ids = new List<string>();
ids.Add(sqlstr);
ids.Add(sqlUpdate);
int j = DAL.sqlTransaction(ids);
if (j > 0)
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "Successfully Inserted", "alert('Image Uploaded Successfully..!')", true);
}
mltImageurl.Text = strFileName1;
}
<asp:Button ID="btnUpload" runat="server" Text="Upload" CssClass="style3" Height="26px"
Width="100px" OnClick="btnUpload_Click" />
CP_vicky
3-Dec-14 7:00am
View
If i submit Upload button without any data given it is showing like System.IO.DirectoryNotFoundException: Could not find a part of the path.
but i need * (ErrorMessage="*")
CP_vicky
3-Dec-14 5:28am
View
No. It is in Table
CP_vicky
3-Dec-14 5:14am
View
<td class="style7">
<asp:Button ID="btnUpload" runat="server" Text="Upload" CssClass="style3" Height="26px"
Width="100px" OnClick="btnUpload_Click" />
</td>
CP_vicky
3-Dec-14 5:06am
View
Ya
CP_vicky
3-Dec-14 5:03am
View
It is again hitting while refreshing after putting a breakpoint
CP_vicky
3-Dec-14 4:47am
View
After data inserted, if i refresh the page without pressing upload button then also data is inserting..
Show More