|
Hey,
I am facing a problem.
When i run "exec sp_databases",it returns only system databases.
|
|
|
|
|
First, this should be in the database forum as it has nothing at all to do with ASP.NET.
Second, does the user account you are running this query under have access to the databases you are expecting to see?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Oh!You are right.It should be in database section.
I am running it under administrator rights.
|
|
|
|
|
so... maybe i'm doing something wrong but i'm having no luck checking if the uploaded file length is greater than i want to allow before an exception is thrown and the site crashes
i thought "Request.ContentLength" would allow me to filter out stuff that s too big and give a friendly error message to the user but, as i said, the site crashes with an exception
i have looked but can find no way to handle this exception gracefully ... any ideas gratefully received
also, please don't tell me to make the max upload allowed bigger ... that doesn't really solve the problem
the files are only supposed to be less than 1mb or so
thanks
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
any more detail will help - please try handling on error event @ global.asax...
|
|
|
|
|
You can use the MaxRequestLength[^] in the web.config to limit uploads. It can be discussed how friendly it is to the user.
But one of the problems with the contentlength is that it's not always present.
"When did ignorance become a point of view" - Dilbert
|
|
|
|
|
How are you getting the file? Something like...
Request.Files[0];
If so you can try something like...
if(Request.Files[0] != null && Request.Files[0].InputStream.Length > 1048576)
{
}
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
thanks to you and the others for the feedback
i discovered the problem is the web server itself having an issue with the uploaded filesize and causing an exception before i even get chance to test and handle it
i had to allow larger uploads and screen for a maxsize before processing but still if a user tries to upload a file bigger than the max i allowed it will cause an exception
not very good design imho
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
Your right, that doesn't sound such a good design. thou I guess there needs to be a way to prevent stupid file sizes by default in case people forget to check within program
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi,
I'm creating a dynamic table and checkboxes at Button_Click event.
The user need to choose some of them and after words press ather button,
my problem is at the post back, how i can show the same dynamic checkboxes with the checked ones.
I tyied to use ViewState, but it's duplicate me the table.
Please help.
10x
|
|
|
|
|
either change your logic to create them at page init or read data at post back and write it back after binding.
|
|
|
|
|
Amar Chaudhary wrote: either change your logic to create them at page init
It works.
10x
|
|
|
|
|
is there key press event on asp.net ? (like in winform) ?
for example when i press enter or Esc on textbox control ?
thank's in advance
|
|
|
|
|
Yes, but you are really thinking of Javascript here. You can attach events to DOM elements, and the textbox supports the onkeypress event.
|
|
|
|
|
yes there is -
To do the same I will recommend you to use JS.
If for some reason you have to do it on server - highly unrecommended - you can turn auto post back on.
If there is something very critical and you need server at all costs then please try using webservices.
|
|
|
|
|
Hi,
In my application I am having a gridview on a page, I want its data to be loaded again only if there is any change at database end in spite of loading same data again and again.
|
|
|
|
|
for that, you have to your own mechanism. You can use cache to store the data and make the dependency on that, so whenever the data will be changed your Cache need to be reloaded, you can do this via callback. For details, have a look
Exploring Caching in ASP.NET
Now once you have new data then you can reload the grid.
|
|
|
|
|
hi
i have C# Winform program and i need to convert it to Webform.
can i get any simple sample for how to show database grid on screen,
add new, update and delete ?
i try to show table on screen like this:
SQL = "SELECT * FROM MEN order by Lname";
dsView = new DataSet();
adp = new SqlDataAdapter(SQL, Conn);
adp.Fill(dsView, "MEN");
adp.Dispose();
GridView1.DataSource = dsView.Tables["MEN"].DefaultView;
but i dont see nothing
|
|
|
|
|
After doing this you also need to call
GridView1.DataBind();
|
|
|
|
|
Gali1978 wrote: i dont see nothing
So what do you see then?
|
|
|
|
|
|
I have a datatable with around 6000 rows and 8 columns. Out of these, I want to extract all the 6000 rows but only 3 or 4 columns. Looping trhough row is not possible. How can i extract only the columns along with the rows to a new datatable? Please help.
Is it possible using LINQ? I am using .Net 3.5.
Thanks,
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
OK, I'll bite, why do you need it in a new DataTable?
Rhys
"I'd rather die on my feet than live on my knees"
|
|
|
|
|
Why because, the requirement is that, the column name should be the name from the database which user entered through UI (User friendly column Names). And one column will be mapped to multiple columns, means column A in datatable 1 will be named as 'TestColumn1' and 'TestColumn2' even though the column values are exactly same. Also, only require 3 or 4 columns out of 8 or 10.
So I can keep the existing table intact and copy only the required columns to new datatable and change the name.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|