Click here to Skip to main content
15,922,533 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionRe: About Calendar Popup Pin
Abhijit Jana20-Jul-08 17:30
professionalAbhijit Jana20-Jul-08 17:30 
AnswerRe: About Calendar Popup Pin
Gayani Devapriya20-Jul-08 18:03
Gayani Devapriya20-Jul-08 18:03 
GeneralPhantom Class Declaration Pin
Brady Kelly20-Jul-08 0:14
Brady Kelly20-Jul-08 0:14 
GeneralRe: Phantom Class Declaration Pin
Brady Kelly21-Jul-08 0:00
Brady Kelly21-Jul-08 0:00 
QuestionWebservice redirection Pin
kallzzr19-Jul-08 15:30
kallzzr19-Jul-08 15:30 
AnswerRe: Webservice redirection Pin
Herman<T>.Instance20-Jul-08 21:45
Herman<T>.Instance20-Jul-08 21:45 
Questionediting in datalist Pin
strawberrysh19-Jul-08 9:18
strawberrysh19-Jul-08 9:18 
AnswerRe: editing in datalist Pin
Imran Khan Pathan20-Jul-08 20:03
Imran Khan Pathan20-Jul-08 20:03 
bbc_sh wrote:
for example name in one textbox and I don't want to change or upload a picture for it.


First check if FileUpload control has file then save it

FileUpload picupload = (FileUpload)e.Item.FindControl("FileUpload1");

string filename="";
if(picupload.HasFile)
{
      filename=Path.GetFileName(picupload.FileName);
      <small>this code  gave you an error because how did you get filename if fileupload control did not have any file</small>
      picupload.SaveAs(Server.MapPath("~/pic/")+filename);
}



your sql query string also will be changed like this

if you do not want to change the picture then you need not to pass picture parameter to the sql query string

string sqlup = "update stt set stname=@stname,stlastname=@stlastname ";
if(filename!="")
{
    sqlup +=" ,picture=@picture ";
}
sqlup +=" where stid=@stid";


your parameter also changed

Also you need not to add parameter of picture file
if(filename!="")
{
   com.Parameters.AddWithValue("@picture","~/pic/"+filename);
}


regards
kHan

please don't forget to vote on the post that helped you.

QuestionUpdate Opener's Parent Pin
Abhijit Jana19-Jul-08 3:36
professionalAbhijit Jana19-Jul-08 3:36 
AnswerRe: Update Opener's Parent Pin
Guffa20-Jul-08 2:47
Guffa20-Jul-08 2:47 
GeneralRe: Update Opener's Parent Pin
Abhijit Jana20-Jul-08 3:18
professionalAbhijit Jana20-Jul-08 3:18 
GeneralRe: Update Opener's Parent Pin
Guffa20-Jul-08 11:40
Guffa20-Jul-08 11:40 
GeneralCustomise Precompiled Web Site Pin
Brady Kelly19-Jul-08 3:10
Brady Kelly19-Jul-08 3:10 
QuestionNeed Urgent Hepl : Printing a Web Page containing GridView Pin
Intellect19-Jul-08 1:06
Intellect19-Jul-08 1:06 
AnswerRe: Need Urgent Hepl : Printing a Web Page containing GridView Pin
Paul Conrad19-Jul-08 15:23
professionalPaul Conrad19-Jul-08 15:23 
Question[Message Deleted] Pin
sugunavathysubramanian19-Jul-08 0:41
sugunavathysubramanian19-Jul-08 0:41 
AnswerRe: how to get datasource from database to gridview Pin
Blue_Boy19-Jul-08 0:58
Blue_Boy19-Jul-08 0:58 
GeneralRe: how to get datasource from database to gridview Pin
sugunavathysubramanian19-Jul-08 1:21
sugunavathysubramanian19-Jul-08 1:21 
GeneralRe: how to get datasource from database to gridview Pin
Blue_Boy19-Jul-08 1:23
Blue_Boy19-Jul-08 1:23 
QuestionRe: how to get datasource from database to gridview Pin
Abhijit Jana19-Jul-08 1:28
professionalAbhijit Jana19-Jul-08 1:28 
AnswerRe: how to get datasource from database to gridview Pin
Blue_Boy19-Jul-08 10:16
Blue_Boy19-Jul-08 10:16 
GeneralRe: how to get datasource from database to gridview Pin
Ma tju20-Jul-08 22:20
Ma tju20-Jul-08 22:20 
GeneralRe: how to get datasource from database to gridview Pin
Blue_Boy21-Jul-08 2:58
Blue_Boy21-Jul-08 2:58 
QuestionScreen resolution problem in asp.net application Pin
Rameez Raja18-Jul-08 23:50
Rameez Raja18-Jul-08 23:50 
AnswerRe: Screen resolution problem in asp.net application Pin
pradeep kumarappagari20-Jul-08 19:25
pradeep kumarappagari20-Jul-08 19:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.