Thanks for the replies,
This has got me thinking more generally about OOP. In a lot of examples I've seen with lots of layers of abstractions. i.e. DAL, Business Layer, UI Layer.
However in "true" OOP wouldn't an Employee class have all these layers embedded inside.
Employee.Draw()...
Here I have two similar ways of populating a simple Employee class.
I'm trying to work out the pros & cons of each method.
1) Seems simpler but tightly-coupled to the DAL(Data Access Layer)
1)
[code]
class Employee
{
public int ID;
public string Forename;
public string Surname;
public...
Thanks for the reply.
I've gone along the lines of what you suggested, and added a LineNo field to the class. The LineNo field is set to equal count, which is a static int which gets incremented in the constructor. This seems to at least work, if slightly untidy.
I have a collection which I wish to display in a datagrid.
It is a collection of a Name class which has Forename & Surname.
This works fine except I would also like to display the indexer of the collection, to give me a line number, in the datagrid like so:
1 John Smith
2 Bob Jones
Any ideas...
Stored Procedures are easier to mantain. It keeps all you SQL code in one place, separating out design logic from business/data logic.
Also if you have a front-end program (for example a form in VB) then if you need to alter something, like a table name or maybe extend functionality, it is...
Use can use table hints so as:
USE pubs
SELECT SUBSTRING((RTRIM(a.au_fname) + ' ' + LTRIM(a.au_lname)), 1, 25)
AS Name, SUBSTRING(t.title, 1, 20) AS Title
FROM authors a INNER MERGE JOIN titleauthor ta
ON a.au_id = ta.au_id INNER HASH JOIN titles t
ON t.title_id = ta.title_id
ORDER...
I think this is cause due to the fact that the "user" ASP.NET doesn't have write permissions. You need to explicity give the ASP.NET account write permissions on your web server
Yeah, that'll do nicely, thanks
I've got this now
Dim EnteredOn as DateTime = CType(CType(e.Item.Cells(3).Controls(0), TextBox).Text , datetime)
Dim Resolved as Boolean = Ctype( CType(e.Item.Cells(4).Controls(1), Checkbox).Checked , boolean)
and it works (just about)
Although I don't really...
Sounds like you need a front-end application to select which procedure to run and enter parameters, rather than trying to do everything in SQL.
Stored Procedure get their speed advantage from the execution plan, this works best if the stored procedure is simple and concentrates on one job. With...
Hi,
I'm fairly new to ASP.NET to hopefully an easy one to solve :)
Whats wrong with this?
Dim Resolved as Boolean = CType(e.Item.Cells(4).Controls(0), Checkbox).Checked
I'm trying to store the value from a datagrid for an update in a datagrid. It works for text but not for a checkbox...
Would it be possible to denormalize your table for a better performance?
Also do you having indexes on the fields you are joining will obviously help.
Perhaps you could index the view?
SELECT @@Rowcount
Will give you the number of rows affected by the previous statement.
It is probably better and safer to immediately store the rowcount in a separate variable.
DECLARE @rc INT
EXEC (@sql)
SET @rc = @@rowcount
RETURN @rc
Heres a couple more ways.
3. Use DTS to output to Excel
4. In Query Analyzer change Tools..Options..Results to results to file, and comma-delimited. Then you can load this file into Excel. (Quick and simple for one-offs)
1. SQL Server is used. (I just recently got a SQL Server locking error whilst posting!). From the http address I think it is used in conjuction with ColfFusion? (CFM)
2. Work out the column sizes, record size, number of records, size of indexes (can be big!), expected growth/month . This should...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.