|
Hi there i'm using file upload control to upload files to the server
but i'm asking how to rename these file which the user specify to upload becuase there are some users write a very long file name
is there is any solution
thanks
|
|
|
|
|
After you upload, you can use PostedFile.SaveAs wherein you can give a filename of your choice.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
I have a crystal report which was running fine but now gives me an error about logon failed and it highlights the following line:
oStream = crpt28.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)
Here is the code I am using:
Imports System.Web.Security
Imports System.Data.SqlClient
Imports System.DateTime
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Dim crpt28 As CrystalReport28
Dim crpt28 As CrystalReport28
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo
Dim Param As SqlParameter
Dim SqlCom As SqlCommand
Dim sqlcon As New SqlConnection("Data Source=server;database=data;user id=user;password=pass")
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
crpt28 = New CrystalReport28
For Each myTable In crpt28.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo.Password = "kris"
myLogin.ConnectionInfo.UserID = "kris"
myTable.ApplyLogOnInfo(myLogin)
Next
CrystalReportViewer1.ReportSource = crpt28
Dim oStream As New System.IO.MemoryStream
oStream = crpt28.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/pdf"
Try
Response.BinaryWrite(oStream.ToArray())
Response.End()
Catch err As Exception
Response.Write("< BR >")
Response.Write(err.Message.ToString)
End Try
crpt28.Close()
crpt28.Dispose()
crpt28 = Nothing
End Sub
|
|
|
|
|
macca24 wrote: oStream = crpt28.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)
Your db credentials that are being used are correct?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
|
Hi all,
I am using asp.net2.0 , C# and sql server 2005.
When i fill the dropdownlist with two color based on contdtion in recordset it fill successfully but on seletedindex _change those color vanish but record remains.
how can i persist data with color ?
the code i used to fill the data is
foreach (DataRow row in dtcompany.Rows)
{
if (row["HM_TRG_FLAG"].Equals(true) )
{
ListItem item = new ListItem(row[1].ToString(), row[0].ToString());
// item.Attributes.Add("Tooltip", row[1].ToString());
item.Attributes.Add("style", "color:GREEN");
ctrl.Items.Add(item);
//ctrl.Items.Add(new ListItem(ctrl.Items.Add(item);, row[0].ToString()));
}
else
{
ListItem item = new ListItem(row[1].ToString(), row[0].ToString());
// item.Attributes.Add("style", "color:RED");
item.Attributes.Add("Tooltip", row[1].ToString());
ctrl.Items.Add(item);
}
}
regards
imran khan
|
|
|
|
|
Check the default setting of drop downlist remove if drop down list have default settings
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
i did not get what do you mean by default setting is it viewstate
please reply.
regards
imran khan
|
|
|
|
|
Hi,
I want to generate two levels of menu items using asp:menu control in asp.net 2.0. how can i do it?
basically, if i have lots of menu items, i want to continue with the menu items on second line or second level. i dont want to make a page scrollable. hope i am very much clear...
modified on Monday, February 18, 2008 1:46 AM
|
|
|
|
|
|
hi sanjubaba,
As we know asp:Menu control provide any level menu but it is not flexible to use directly becuase your menu will become static. If you want to change menu items than you have to change front-end. Hence it is better to use database driven menu using asp:Menu control.
Just check this link.
Building a Database Driven Hierarchical Menu using ASP.NET 2.0
Hope this will help you.
Thanks & Regards
Dilip Kumar Vishwakarma
If this post is answer for your query then don't forget to mark as an answer.
|
|
|
|
|
I created a form with some Controls and Validators
It works well on localhost
but after publishing, it works somtimes and sometimes it gives the error "Unable to validate data."
this is my page
http://www.mersaal.com/FeedBack.aspx[^]
Can anybody gess the source of this error
I say again that the error appears sometimes
Mohamed Gouda
Egypt
|
|
|
|
|
Are you using AJAX and javascript at same time ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
playing with bugs ) wrote: Are you using AJAX and javascript at same time ?
I used none of them
Mohamed Gouda
Egypt
|
|
|
|
|
Hi,
I think that problem might be occured at the time when user enter any special tag like chararcter in textboxes like '<' or '>'.
So first you check with this possibility and write RequestValidate = "false" in Page directive.
But this attribute affects security of your site.
Regards,
Amar
|
|
|
|
|
amargujrathi2006 wrote: So first you check with this possibility
First, thanks for the good hint , the tag like characters generates an exception that I need to handle
But the old problem still not solved
Mohamed Gouda
Egypt
|
|
|
|
|
Seems like problem in the ViewState. Have to tried searching in www.asp.net forums?? Click here[^]
|
|
|
|
|
We're using AJAX with an ASP.Net 2.0 site, and we've come across a problem.
We have a simple repeater control that contains a label, textbox, and checkbox. We've ajaxed out page and all is working well, except for this one little problem:
Our repeater controls are in their own update panel, and wheneven we check a checkbox in our repeater control, everything AFTER the updatepanel with our repeater controls in it, dissappears.
We've googled a ton and can't figure this one out. We would be thankful for any help.
Paul Brower
|
|
|
|
|
Does your repeater make me.Context.Response calls? Me.Context does not always return the same object.
|
|
|
|
|
Hi Poul,
Ya it will happen as it will get reset.
you will have store the changes in each post back whether it is asynchronous and synchronuos.
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
It turns out we had our FooterTemplate innpropriately formatted. (Ok, it was missing altogether).
By adding the FooterTemplate and a tag, it works properly now.
Thanks for your responses.
|
|
|
|
|
Hi to all
system.io.directory.createdirectory(Physicalpath) which crate directory in our local system.
when i host my code into server ,i want to create a folder in my local system directory.
i don't want to create directory in the server, i want to create file in local system. please understand my question and give good response
This is haneef.............................................................
|
|
|
|
|
You have a basic problem of understanding. Your C#/VB.NET code only ever runs on the server. For this reason, and many others, it's not possible to create a folder on the client side.
If you mean you want to create folders on the server, you cannot ever create them above the application root, that's another issue of security.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi
I have an image which is 800px wide
however some users view this image on a screen which is 1024px wide
is there a way t stretch the image across the screen, to fit to screen?
thanks in advance
|
|
|
|
|
You just need to get your fingers under the edge and pull.
What kind of image? Is it one colour (cause if it isn't then stretching it will make it look rather odd)?
|
|
|
|