|
public partial class ProductCatalog : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
return;
PopulateCategoriesLINQ();
///OR
PopulateCategoriesADO();
}
private void PopulateCategoriesADO()
{
string xmlfile = Server.MapPath("CategorySales.xml");
DataSet ds = new DataSet();
ds.ReadXml(xmlfile);
categorySalesGridView.DataSource = ds;
categorySalesGridView.DataBind();
}
//example of using Linq
private void PopulateCategoriesLINQ()
{
XDocument xdoc = XDocument.Load(Server.MapPath("CategorySales.xml"));
var cats = from cat in xdoc.Descendants("Production.ProductCategory")
select new
{
oldpage = cat.Element("Category").Value,
newpage = cat.Element("Total").Value,
};
categorySalesGridView.DataSource = cats;
categorySalesGridView.DataBind();
}
}
}
|
|
|
|
|
Dude use Code block to code for neat appearance.
BTW I have bookmarked your blog(found something interesting).
Cheers
|
|
|
|
|
Get DTS work with extracts from old Unix FoxPro box, usual limited options on extracts and other stupid stuff
Just back from Holiday this week as well. 900 miles round Scotland on a bike. Seen more of Scotland in 4 days than I've seen in the rest of my life.
|
|
|
|
|
Hi Frank,
This is regarding the article you wrote on 26th March 2007.
I'm trying to make the paging work with sql server 2005 and ASP 3.0 (or VB 6.0) and is running in to issues when I use "with" and "row_number", apparently ADO doesn't like it. Do you know how to make it work with classic ASP or a workaround for that?
A reply would be highly appreciated.
|
|
|
|
|
God its warm in Scotland this week. a very pleasant change for sure.
Our DBA left and I've taken over his role,Quite nice at first doing some serious SQL for a change but the qty of chaff requests is a little tiring after a few weeks.
Made some movement on .NET 2.0 and had a play about with Enterprise libraries 2.0 as well. Entercountered some problems with Enterprise Library Configuration tool which crashed on me and was basically useless. Had to remove June 2005 and latest Jan 2006 versions. Reinstall Jan 2006 and rebuilt the thing, I now have an Enterprise Library that seems to function
Another curious issue with with the Enprise Libraries not allowing build/compile of 2005 web site. It adds some XML into the web.config as well as its own config file. I removed the web.config entries supplied by EnterPrise tool and all went well after that.
Abandoned studying on WebServices 70-320 due to DIY committments at home and at other foks homes as well.
===============================================================================================
Look where you want to go not where you don't want to crash.
Bikers Bible
-- modified at 6:46 Friday 9th June, 2006
|
|
|
|
|
VBA yuch... I've been doing C# for too long.
Needed a wee bit for getting filename from fullpath. Search google and got a bunch of over engineered fluff. So Heres my two line approach
Pos = (InStrRev( FilePath, "\", -1 , 1))
filename = RIGHT( FilePath, Len(filename) - Pos)
Look where you want to go not where you don't want to crash.
Bikers Bible
|
|
|
|
|
Document systems for the last few months with Esker Delivery ware and getting my hands all dirty with crystal reports.
Crystal is getting easier or duller and quite diffrent to MS reporting services. Things I could do in 5 mins in Reporting services can take an age in crystal. Its not all bad and and once you get your head round it its gets fairly easy.
Now on Delivery ware version 4 which has some great enhancement most notably is the web service front end they put in.
Exam 70-320 next, now I've nearly finished the refurb of the old house I bought I have to get studying in earnest.
Later
Look where you want to go not where you don't want to crash.
Bikers Bible
|
|
|
|
|
Moved back to Scotland, bit wetter than South of England, but at least I can afford to buy a house.
Settled on a nice job with a small insurance company in Glasgow; new Industry and lots to learn.
Passed my 70-315 ASP.NET C# since I have a bit more personal time at last. Got a very reasonable 943/1000 94% to us non microsoft mortal.
One to go for my MCAD 70-320 C# Web Services.
|
|
|
|
|
HTML and icon design with changes to some datagrids. Weekend and somme well deserved beer threatens.
Have to get back on the studying front for my MCAD and layoff the XBOX Cron of Riddick.
|
|
|
|
|
Raking through third party developed code ASP.NET vs c# code. Some real nasties in the code: No Data Layer, mixing presentation and business logic, no back end classes to speak off, mix of view and session states for same variables as well as some very weird logc and a unquie approach to 3 layer model (there is none).
I'm trying hard to improve the code and introduce some clarity to the logic without having to rewrite the whole application.
Pages and pages of code and not a single usefully little nugdet anywhere to be seen....*sigh*
Did drop in my standard datalayer and introduce a dataset table row counter so I could have a message telling users "no records for this search".
-- modified at 9:32 Wednesday 14th September, 2005
|
|
|
|
|
Start the week on a good foot. My MRP extract of 10-20 million records into SQL is going well and near finished the data extraction. Rewrote the DTS for the import in SQL; using SQL transactions; should be more efficient that bulk copy to temp tables that is the normal pratice here.
Also setup a global MRP database for reporting and started to replace with a view linked to the MRP db. This should have a good effect on stopping table copy creep and old versions causing strange results.
Now to start the reporting section.
Directors here keep telling me what a good guy I am. Seems my simple formula of "Do what your asked for" works. Funny how everyone else seem to put barriers up you never seem to get what you ask for. Oh well onwards and upwards.
|
|
|
|
|
Fighting all week with Progress 4GL database code to get about 10Gb of data into SQL Server 2000. Even got a few Progress Memory violation ; does not like too much transaction history dumped out.
Did manage to get a cool date find for direct DTS import from Progress to SQL Server; seems Progress chucks out ? instead of nulls.
// VBs Script on DTS
if DTSSource("Col008") <> "?" THEN
DTSDestination("ldh_date_frz") = DTSSource("Col008")
//
Wrote New Article for Reporting Services and posted it on Code Project.
Still have DTS to write to import the last 10 days records from the ERP box so I don't have to pull 2 years worth every night. Should be able to do date check with out deleting or doubling records.
Working hard for my MCAD and starting from the ground up with C#, its amazing what wee titbits you pickup even if you think you know it all.
-- modified at 8:36 Thursday 1st September, 2005
|
|
|
|
|
OK I'm starting a Blog, meaning to for quite a while. The nice folk at code project even provide me with my own BLOG cool.
|
|
|
|