|
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.
|
|
|
|
|
Hi,
how can i update opener parent if opener is closed ?
This are the scenario
1. MyPage - > MySecondPage
in This case, i am able to refresh Mypage using ProgressWindow
2. MyPage -> MiddlePage -> MyScondPage
in this case i have to update MyPage , but problem is , when MySecondPage opening , its close MiddlePage [ This is Requirment ]. Now i am unable track the parent . Please Help
Check out the close
function CloseNupdateWindow()
{
if ( window.opener && window.opener.closed )
{
}
else
{
window.opener.location.href = window.opener.location.href;
if (window.opener.progressWindow)
{
window.opener.progressWindow.close()
}
window.close();
}
}
cheers,
Abhijit
|
|
|
|
|
Do you need to open a new window for the second page? Can't you open it in the same window?
Otherwise, close the window for the middle page from the second page, so that you can pick up it's parent before you close it.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Guffa wrote: Do you need to open a new window for the second page? Can't you open it in the same window?
No, i have to open it on "Second Page". This is Requirment.
Guffa wrote: close the window for the middle page from the second page, so that you can pick up it's parent before you close it.
you want to mean, i just close middle page from Second page ? but after that will i able to get the orginal parent id ?
Thanks for response !!!
cheers,
Abhijit
|
|
|
|
|
Abhijit Jana wrote: you want to mean, i just close middle page from Second page ? but after that will i able to get the orginal parent id ?
No, before that you are able to get the parent of the middle page window. Put the reference to the parent window in a variable, so that you can still get to the parent window when you have closed the middle page window.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I have a request to add features to a precompiled web site. I understand this to not be possible under normal circumstances, but is there any way to do this via underhanded techniques, such as intercepting requests etc?
|
|
|
|
|
Hello Help Desks,
I am searching a solution for printing a ASP.NET 2.0 Web Page Which contiain GridView.
Description : Gridview is created by adding Rows and Columns dynamically.
I am creating a Cross Tab report here, so the no. of columns are in dynamic.
I need to print this gridview on A4 Size paper which is always more than 20 columns. But While taking the print out it shows me only the first few columns which fit in A4 [here Last column may lost its data if its width is larger than A4]. And main problem is it never carry/wrap the printing to next page if then number of columns are larger than page size.
It takes only one page printout.
I am also facing a Font problem here. I have set the Font size to 13 usiing CSS to grid, but it shows font in very small size.
I have tried using
w
Window.print(); on client side, System.Drawing.Printing on server side but not working any thing..
PLZ PLZ. Help me out ...
Regards
|
|
|
|
|
Intellect wrote: Hello Help Desks
These forums are not help desks. People are free to help if they want.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
|
SqlDataSource1.SelectCommand = "Select columns from TableName";<br />
GridView1.DataSourceID = SqlDataSource1.ID;<br />
GridView1.DataBind();
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
|
No problem.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
Why you delete the Message ?
cheers,
Abhijit
|
|
|
|
|
And I am courious to know why he/she deleted message.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
he dont want to share with others his question. lame
awek
Programmer
Subang Jaya,Selangor, Malaysia
|
|
|
|
|
Yes, it seems.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
hello ,
i have question ,
suppose i have to create a web site and i want my web site resolution automatically set for every computer. each computer has diffrent resolution. how i set it?
and
i have developed a web application using asp.net.Its working in normal screen 600x800. But it doesn;t work in LAPTOP(1024X728). I can get only part of screen. Anyone can help me out.
Regards
rameez
|
|
|
|
|
all the sizes of forms and tables and some controls u show in form should mention in percentage wise.
Ex : declare width : 100% instead of declaring width : 700px
this will work for u for all the resolution types.
Pradeep Reddy
|
|
|
|
|
i have user following Function
function validate()<br />
{<br />
<br />
if(window.parent.location != null)<br />
{<br />
window.close();<br />
opener.location="login.aspx";<br />
} <br />
}
I have Login page , HomePage. ExceptionPage, Application Page. if Exception page comes inside a popup , its redirect to login page , but when comes it in a main windows, it follwing function does not work, it try to close the windows , thoug it parents is null.
please help.
cheers,
Abhijit
|
|
|
|
|
I have solved this problem.
cheers,
Abhijit
|
|
|
|
|
i have 2 table in sqlserver. i want do this command
insert into dabirestan (amuzeshgah) values (select amuzeshgah from dabirestan1)
i want fill the record of table dabirestan1 to table dabirestan
i want write a query. how is my query cammand. do any body know?
|
|
|
|
|
Post it into SQL Forum .you will get better answer. this is asp.net forum
cheers,
Abhijit
|
|
|
|
|
Are there any free tools to use to backup the database on my server and put the backup copy on another computer on the same network??
Does sql server 2000 have these kinda programs or plugins??
I also have a problem when I try to access sql server 2000 from the server. I need assign a username and password on the enterprise manager and query analyzer so that no one can open them from the server..how can I do that??
|
|
|
|
|
Nada Adel wrote: and put the backup copy on another computer on the same network
You can use DTS to transfer data from one server to another. You can do this via enterprise manager.
Nada Adel wrote: I need assign a username and password on the enterprise manager and query analyzer so that no one can open them from the server..how can I do that??
You want to assign user name and password for database ? You can create users and permissions from the enterprise manager.
BTW, this has nothing to do with ASP.NET. Please don't cross post. This post should be in SQL forum.
|
|
|
|
|
I know how to create a username and passwords on the databases. what I meant was how to set username and passwords on the programs themselves like when I user opens the enterprise manager he is prompted to enter username and password..
|
|
|
|