Showing posts with label internal. Show all posts
Showing posts with label internal. Show all posts

Saturday, February 25, 2012

Aspx fashion tip... ;)

Hi!

Im building a site for internal use for a company i work at.
And im having hard to decide what to do. The alternatives are

comma separated lists vs separate tables.

For example.. I will use a number of different type of objekt that all will hold 1 or more document links, phone numbers, emails etc

As far as i can i i have 2 possibilitys. One is to add textfields for each of these subojects in each objects tables. Then i add all info as commaseparrated lists in 2-3 layers wich i then save in the respecive objects fields.
(Look like something below for example )
,comment'emailadress,comment'emailadress,

Or i add 1 table for each subobject type wich manage the subobjects or link between different objects
for example:
table layout for email:
id | parent_type | parent_id | comment | email

Or for example contacts a mediator table:
id | parent_type | parent_id | contact_id

Hope you understand what i mean, would really appriechiate suggestions, comments regarding what can be considered as "best practise" in these cases. Putting it in separate tables should make searches easier, and coding easier in my book. But again im thinking if perhaps commalists is a faster and more recource conservative way of doing it + to me it feels like (perhaps i have no reason to think this?) making tables for items like feels like a timebomb if you exhaust your idfields identity count. Though this app will be used by perhaps 100ppl at most so perhaps not an extremely utilized webapp.

Anyway glad if you could give me some input!

I prefer seperate tables, as this gives clearer description of data structure/relationship, and it is much easier to manipulate the data in seperate tables.|||

Yeah well separate tables sure is the easiest way to get around it considering searches, changes when built etc.

Practically for me it will mean perhaps 3-5 querys in one page instead 1-2. So that is the main drawback i guess wich perhaps wont inflict to much.

Anyway my main concern was if there was anything that motivated commalists or its just a small gain for quite a bit more work in creating/changing.

|||

"if you exhaust your idfields identity count"? If you were inserting a new record once every second non-stop, it'd take over 68 years to exceed the limits of an int. And when you get there, consider upgrading to SQL Server 2050 which solves that problem automatically for you. But if you think there is the possability that your app will need to run for 68+ years without a change, or if your think you'll need to insert more than 86,000 rows per day, then you might consider a bigint.

|||

Yeah did som calculations and came to the same conclusion ;)

Anyway think i will go for tables, for convineance sake.

Thursday, February 9, 2012

ASP.NET 2.0 / ASP and SQL Server 2005

I'm having to do some maintenance on a legacy site done in "classic" ASP. I've taken the site onto our new internal win2k3 box as it doesn't need to be public any longer and put the DB on sql server 2005. All good so far.

I can't get the app to connect to the DB at all. If I use the exact same connection string that works in an asp.net 2.0 app on the same server, it doesn't work. I don't even have to do a query, merely opening the connection will break it.

I use...
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.open "Data Source=********;Initial Catalog=intranet_database;Integrated Security=True" '(that's the connection string that works just fine on the asp.net app)

I get..
Microsoft OLE DB Service Components error '80040e21'
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
/v1/testing/default.asp, line 13

Most of the stuff I can see relates to datatypes and so on, but given the above I can't see how that might be.

Any ideas? Please! ;-)

I solved this by creating a black UDL file on the desktop and it generated a very different connection string. When I try and grant the ISR_MACHINENAME user access to the database I keep getting this not very helpful error message.

|||

Can't you edit a post? What I meant to say was...

Yeskin Gallen:

I solved this by creating a blank UDL file on the desktop and it generated a very different connection string. When I try and grant the IUSR_MACHINENAME user access to the database I keep getting this not very helpful error message...

TITLE: Microsoft SQL Server Management Studio

----------

Cannot show requested dialog.

----------

ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

----------

The server principal "BEL-INTRANET-01\IUSR_BEL-INTRANET-01" is not able to access the database "self-builder-v1" under the current security context. (Microsoft SQL Server, Error: 916)

For help, click:http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=916&LinkId=20476

----------

BUTTONS:

OK

----------