|
Set your data source to only return items starting with A
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
How do I do that?
I am using a user control so that one the first screen all of the items are available, but only those starting with the letter A are shown unless the user sorts the gridview. On all subsequent pages, however, only the selected items are shown, and all of those must appear.
|
|
|
|
|
you don't want full alphabetisation, just to show the As on the first page and on subsequent pages to show the rest ?
You're going to have to manage paging yourself, and modify the SQL to the datasource to return the page you want.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Perhaps I wasn't clear enough.
Page 1- Select from All available items, but default screen shows only items starting with letter A. The user can select or search for other items by clicking on a letter of the alphabet.
Page 2 - shows All of the selected items from page 1.
I need help with Page 1 and only showing the items that start with letter A.
|
|
|
|
|
Page 2 is obviously unrelated to the current task. Page 1, shows only items starting with A, by default. At some point, in a way you're not defining, it goes on to show all items. Right ?
Refer to my first reply. The *best* way to only show items starting with a, is not to filter them somehow in your presentation layer, it's to only request those items from your data store. So, if you only want to show A or show all, you need two different requests for data, one which returns the 'a' items and one which returns all. You'd swap between them based on whatever state change it is that causes you to want to view all. I'd have assumed you'd be paging by letter, which would mean you'd write your own paging code ( and control, I would think ) and from there request each letter as required, but this is even easier.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hello,
How do i get rid of the "new line in constant" error in:
<a style="color:#002D65;font-family:Verdana" href='<%#"Categorie.aspx?ca=" + DataBinder.Eval(Container.DataItem,"Parinte")+ "sel=" + DataBinder.Eval(Container.DataItem,"Id")"%>'> <%#DataBinder.Eval(Container.DataItem, "Nume")%> </a>
|
|
|
|
|
Well, I would remove stuff until it works, then work backwards, this is a bit convoluted. I would replace the href stuff with a single function call that passes the data item to a method that generates the URL on the back end. This is just too messy.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
i have a windows service(VB.net running on windows 200 server accesing sqlserver2000 on another server)running in my appserver and sqlserver running in dbserver.
the service looks for feeds(.csv files with a particular name, this file arrive every 2 hrs.) in D/Feeds of appserver, if it found the file it fetch and insert the data to the database and generate a .csv file for one of our partner system and save it in D/outputs.
my issue is my service fails to generate feeds if my database server get rebooted. now i am restarting the service if i am not seeing the output file in the specified time intervell.
i think my service cannot access the database once the dbserver get rebooted.
a solution for this is greatly appreciated.
|
|
|
|
|
What does this have to do with ASP.NET ?
Does your code try to reconnect to the DB if hte connection fails ? Does it generate an error log ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
When the service fails to start it most probably leaves a message in the event log.
So check your event log.
My guess is that your service tries to start before another service which it depends on.
When you find out which service that is, you make your service dependant on it.
|
|
|
|
|
Hi, my requirements are same as of CodeProject.com. I want to create a page(aspx) for every user who register on my website. Same as CodeProject.com creates a new pages when one writes a article.
For eg. if a user register on my site and a ID assisgned to him is John9878. Then system should create John9878.aspx and John9878.aspx.cs. Can somebody help me on this problem.
|
|
|
|
|
I would say you need a subfolder ( www.mysite.com/users for example ) and use URL rewriting to redirect John9878,aspx to redirect to a standard page which takes that name as a parameter and looks it up in the database.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Amandeep Singh Bhullar wrote: Hi, my requirements are same as of CodeProject.com. I want to create a page(aspx) for every user who register on my website. Same as CodeProject.com creates a new pages when one writes a article.
I don't think it does. It just looks like it does. It is just a page backed by a database and to make nice URLs you can create an HttpModule or HttpHandler that examines the URL from the browser and translates it to an internal value that then renders the page. As far as the outside world is concerned it looks like a new page file has been created.
URLs just look like file paths because originally they were just file paths in the server. These days a URL can refer to anything. Look at ASP.NET MVC routing to see some powerful stuff done with URLs.
|
|
|
|
|
Colin Angus Mackay wrote: I don't think it does. It just looks like it does.
Check it out(Just For Example)
http://www.codeproject.com/KB/miscctrl/vbnet-multitab-browser.aspx
This URL depicts that it is a new page. Also this page is indexed in Search Engine. If it is simple URL rewriting, then how Search engine index it.
Same is the case with all articles
|
|
|
|
|
Amandeep Singh Bhullar wrote: then how Search engine index it.
Because the search engine doesn't know how the page got rendered. It doesn't care how it got rendered. It just has a rendered page at a specific URL that it can put in its cache.
The website I've been working on the last few months has about a dozen page templates (all aspx files) but if you were to look at it in a search engine you'd see hundreds of "pages" on the site. All that information is in the database, not in files.
|
|
|
|
|
|
I have a treeview in the lefthand side of my aspx page. When I clicked on any of the nodes, there will be a grid showing the details on the right hand side. There is an edit button also for each row for editing the details. Everything is working perfectly fine.
The issue: if I clicked on the Edit link, Update and Cancel button will apppear in the Grid. And without performing any updating(means without doing any edit), if I clicked on the left hand side of any other node, corresponding details will appear in the Grid without collapsing the row. if I code as below, update event itself is not firing.
if (GridView1.EditIndex >= 0)
GridViewEditIndex = -1;
Anybody have any idea why it is happening? How can make the row collapsible even though the Update and Cancel button in the Grid is open in GridRow? Please help. Please let me know if I need to provide more info.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Hi Everyone
I have an application that is running fine on my development and QA environment but it's giving me problems on production. I get an error "Child nodes not allowed"
on thi sline "<providerOption name="CompilerVersion" value="v3.5"/>;"
Parser Error Message: Child nodes not allowed.
Line 126: compilers
Line 127: compiler language="c#;cs;csharp" extension=".cs" warninglevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
Line 128: provideroption name="CompilerVersion" value="v3.5"
Line 129: provideroption name="WarnAsError" value="false"
Line 130: compiler
So I would like assistance at what is the cause and how to solve this problem.
Thank you
Mpumelelo Khuzwayo
MP
|
|
|
|
|
This should be a common need but I haven't found a method so far. What i want to do is, in a result from a SQL Query, define some columns to be, say, Full Name on load to the datagrid rather than 3 cols for first, mid and last name. so, no joins, just select from db, manipulate data, bind to datagrid.
Currently i am using DataTable as I only need read-only to the data. this code looks like it might work:
Dim resultsDataSet As New DataTable()
Dim FullName() As DataColumn = { _
resultsDataSet.Columns("FIRST_NAME"), _
resultsDataSet.Columns("MID_NAME"), _
resultsDataSet.Columns("LAST_NAME")}
Dim myDataAdapter As SqlDataAdapter = New SqlDataAdapter(cmd)
myDataAdapter.Fill(resultsDataSet)
DisplayResults.DataSource = resultsDataSet
resultsDataSet.Columns.Add(FullName(2))
DisplayResults.DataBind()
But I get the error "'column' argument cannot be null." when i try to load the datagrid. also, i don't know what i should but in the declared array FullName() during bind - 2 is a guess based on the fact that there are 3 columns defined for this one. In addition, it's *OK* to have the new table be null if First, Mid and Last (name) is in fact not given in the data source.
TIA
Issue resolved - I did the concatenated table in the db instead.
modified on Monday, February 23, 2009 11:03 AM
|
|
|
|
|
FYI if you are doing read only, the sqldatareader is more efficient. Especially for larger result sets.
I didn't get any requirements for the signature
|
|
|
|
|
i suppose you mean to replace
New SqlDataAdapter(cmd)
with New SqlDataReader(cmd)
|
|
|
|
|
Something like this...
string queryString =
"Put your sql here and use parameters if necessary";
using (SqlConnection connection =
new SqlConnection(connectionString))
{
SqlCommand command =
new SqlCommand(queryString, connection);
connection.Open();
SqlDataReader reader = command.ExecuteReader();
DisplayResults.DataSource = reader;
DisplayResults.DataBind();
// Call Close when done reading.
reader.Close();
}
I didn't get any requirements for the signature
|
|
|
|
|
thanks - i'm new to all this and it's good to be reminded of when to use what in the ADO.NET world.
|
|
|
|
|
Hi all.
I have .NET web application, which gives user overall sales performans and uses iframe to load some detailed sales data. Because of that iframe design the applicaion is loaded slower at first run (I guess it has to load 2 pages: the main and the iframe page). The question I have is: If I increase memory on my server will the application run faster?
Thanks.
Alex.
|
|
|
|
|
alexfromto wrote: The question I have is: If I increase memory on my server will the application run faster?
Probably not.
I have a suggestion for you...
Check your IIS Settings, you will see that the amount of ram each application pool can use is configurable.
Your issue could be a sql query that is not optimized. How long does the sql query take to run?
If that isn't the issue you could install this http://www.jetbrains.com/profiler/[^]
It will enable you to determine how long each .net method is taking to execute.
If that doesn't help you could install fire fox, firebug and http://developer.yahoo.com/yslow/[^]
Basically, you need to rule out a hole host of issues before you go adding ram to your web server.
I didn't get any requirements for the signature
|
|
|
|