Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Puck42
Oct 7, 2005

At work I'm making a program n C# for adding new users to our AD and I want to set it up to send information to the newly created users via e-mail.

Does anyone have any information on sending e-mail through exchange? All I can find is using Outlook which isn't working too well. Should I just use SMTP instead?

Adbot
ADBOT LOVES YOU

wwb
Aug 17, 2004

^^^^Use SMTP (protip: excange is generally also a SMTP server).

In .NET 1.x, you need to use System.Web.Mail. In .NET 2.0, use System.Net.Mail.

Grid Commander
Jan 7, 2007

thank you mr. morrison
Just to be clear, this is just an access layer for smtp.

Here is a bit of overkill information. Feel free to ignore it unless you are a bit more interested in mail on an Exchange box.

I used to work for Exchange, and can say that it is easier to use smtp in most cases... even if there is an alternative available in Exchange. (Special aspects of Exchange are slightly more difficult to use because they are mostly available through COM and active directory.)

Just for a bit more background: If you are using an older version of exchange, then it is built upon the smtp stack included with windows xp. New versions of Exchange have their own smtp stack. Basically though, it is still smtp at its core. Anything that can be done as far as sending and recieving mail is concerned can be done using industry standard techniques (smtp, imap, pop) on an exchange server.

Exchange also offers some other extensions and features to smtp.
These mostly relate to
better performance (more messages per second),
better storage features (mailbox quotas and backups),
better user access options (stopping a recursive reply all from unprivilaged users),
spam blocking,
and much more security.

pliable
Sep 26, 2003

this is what u get for "180 x 180 avatars"

this is what u fucking get u bithc
Fun Shoe
What would be the easiest way to accomplish the following:

1. Read an XML file.
2. Grab the data in between the tags.
3. Assign data to strings for each entity.

I've been yanking out my hair trying to figure out how to do this with an XmlDataSource on a code behind ASP.Net page with no luck at all (as simple as it sounds like it's supposed to be). I then talked to someone else and he informed me of the XmlDocument class, but then it references so many other classes that I'm not even sure to begin. While I'm at it actually, tell me if this code looks right to you:

code:
//directory is "C:\Temp\"
xmlDataSource.DataFile = directory + "App.xml";
xmlDataSource.XPath = @"Application/LoanName";
Response.Write(xmlDataSource.Data);
//I know in this case I didn't assign it to a string...but I simply wanted to test
//and see if I could even get the data :(.
XML File:
code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<Application>
   <LoanName>Florida Credit Union</LoanName>
</Application>
Help me with your brilliant minds good sirs. Thanks as always <3.

pliable fucked around with this message at 21:52 on Jan 8, 2007

wwb
Aug 17, 2004

2 Basic Ways to Hit This:

1) Use XmlSerialization to deserialize the XML into a class. Easiest if the Xml is managable for this purpose. Can you show a more full example of the xml?

2) Use XmlDocument to load the document, then loop through appropriate nodes and pull the data. This can be the easiest method under some circumstances. Something like:

code:
XmlDocument doc=new XmlDocument();
doc.Load(fileName);
foreach (XmlNode n in doc.DocumentElement.ChildNodes)
{
    //do something with da child nodes
}
XmlDatasource is not meant for this kind of stuff-it is there to expose Xml data to web controls, not parse Xml data for a program.

Fiend
Dec 2, 2001

pliable posted:

clipped

code:
    XmlDocument xld = new XmlDocument();
    xld.Load(@"C:\what.xml");
    Console.WriteLine(xld.SelectSingleNode("Application/LoanName").InnerText.ToString().ToString());

Fiend fucked around with this message at 23:05 on Jan 8, 2007

Boogeyman
Sep 29, 2004

Boo, motherfucker.

pliable posted:

Stuff

Here's how I usually do it. It might not be the most efficient way (I've never messed with anything else), but it works.

code:
' Create a new XML document.
Dim importDocument As New XmlDocument

' Load the document from an XML file.
importDocument.Load("c:\whatthefuckever\something.xml")

' Here's how to reference the root node...in your case, "Application".
Dim rootNode As XmlNode = importDocument.DocumentElement

' Here's a reference to the "LoanName" node (assuming there's only one).
Dim otherNode As XmlNode = rootNode("LoanName")

' Here's how to get the text out of that node.
Dim someString As String = otherNode.InnerText

' You could do this poo poo too (again, assuming only one)...
Dim anotherString As String = rootNode("LoanName").InnerText

' If you have attributes on an element, you can get to them like this...
Dim attributeValue As String = rootNode("LoanName").Attributes("Something").InnerText

' If you want to loop through nodes, do it like this...
' Note:  this is if you have multiple LoanName nodes under Application.
For Each currentNode As XmlNode In rootNode.SelectNodes("LoanName")
  Debug.WriteLine("LoanName text:  " & currentNode.InnerText)
Next
Hopefully that helps a bit. Maybe some other people will chime in if there are better ways of doing this type of thing.

pliable
Sep 26, 2003

this is what u get for "180 x 180 avatars"

this is what u fucking get u bithc
Fun Shoe

wwb posted:

Can you show a more full example of the xml?

I can't share the actual XML file, but here's basically what it looks like:

code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<Application>
   <LoanName>Florida Credit Union</LoanName>
   <StreetNumber>6969696969</StreetNumber>
   <StreetAddress>Buttes Dr.</StreetAddress>
   ...etc etc more address info and other crap
   <ReportOne type="pdf">
      <note id="1">poopoo.pdf</note>
   </ReportOne>
   ...etc etc (there can be multiple or no "note" nodes under the various "Report" nodes)
</Application>
There are a set of nodes for various personal information, then a set of nodes for information regarding various files that came packaged with the .xml file.

pliable fucked around with this message at 23:38 on Jan 8, 2007

pig-fukr
Nov 3, 2002
I've put in a many hours on this one now and I'm not much further then I was when I started...

Is it possible to have to versions of the same dll representing the same namespace with many of the same classes coexist on the same web application?

I got as far as referencing both assemblies, but I end up with "your class" is ambigious in the namespace "your.custom.namespace". The practical application here is I have to seriously restructure a core namespace but I cannot remove the existing namespace as it will break quite a bit of functionality.

genki
Nov 12, 2003

pig-fukr posted:

I've put in a many hours on this one now and I'm not much further then I was when I started...

Is it possible to have to versions of the same dll representing the same namespace with many of the same classes coexist on the same web application?

I got as far as referencing both assemblies, but I end up with "your class" is ambigious in the namespace "your.custom.namespace". The practical application here is I have to seriously restructure a core namespace but I cannot remove the existing namespace as it will break quite a bit of functionality.
Afaik, you can't have different implementations of the same class in the same namespace. There's no way to distinguish which class should be used.

FuraxVZ
Dec 18, 2004
Incredibly Unimaginative

pig-fukr posted:

I've put in a many hours on this one now and I'm not much further then I was when I started...

Is it possible to have to versions of the same dll representing the same namespace with many of the same classes coexist on the same web application?

I got as far as referencing both assemblies, but I end up with "your class" is ambigious in the namespace "your.custom.namespace". The practical application here is I have to seriously restructure a core namespace but I cannot remove the existing namespace as it will break quite a bit of functionality.

I'm not sure exactly how, but did you try aliases? Or extern alias?

Here's a code project with a basic write-up: http://www.codeproject.com/csharp/aliases.asp

At least with extern alias, you can distinguish the same namespaces with different names: http://msdn2.microsoft.com/en-us/library/ms173212(VS.80).aspx

Hope that helps.

wwb
Aug 17, 2004

pliable posted:

I can't share the actual XML file, but here's basically what it looks like:

code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<Application>
   <LoanName>Florida Credit Union</LoanName>
   <StreetNumber>6969696969</StreetNumber>
   <StreetAddress>Buttes Dr.</StreetAddress>
   ...etc etc more address info and other crap
   <ReportOne type="pdf">
      <note id="1">poopoo.pdf</note>
   </ReportOne>
   ...etc etc (there can be multiple or no "note" nodes under the various "Report" nodes)
</Application>
There are a set of nodes for various personal information, then a set of nodes for information regarding various files that came packaged with the .xml file.

How is that Reports structure handled? Is it actually dynamically named nodes, or is it something like <reports><report /><report /></reports>?

Also, do you have a schema? If so, you can use xsd.exe to generate a class for deserialization, then use XmlSerialization to put the data in that class.

Finally, I forgot to mention one .NET 2.0 method: implement IXmlSerializable. This will let you use XmlSerialization but will not tie you to the default rules of XmlSerialzation. Which might be what you need in this case.

pig-fukr
Nov 3, 2002

FuraxVZ posted:

I'm not sure exactly how, but did you try aliases? Or extern alias?

Here's a code project with a basic write-up: http://www.codeproject.com/csharp/aliases.asp

At least with extern alias, you can distinguish the same namespaces with different names: http://msdn2.microsoft.com/en-us/library/ms173212(VS.80).aspx

Hope that helps.

After providing my research I was able to convince the powers that be that a major namespace restructuring would best be handled by changing the root name of the namespace itself. Problem solved.

** Extern aliases were the closest I came to a workable solution though, thanks for that.

MisterZimbu
Mar 13, 2006
What's the best way to program for something that requires your module to be registered on the GAC?

I have a VS2005 Template wizard I've been working on, set up to automatically itself and register itself in my GAC every time it successfully compiles (using "gacutil.exe /if $(TargetName)" in the post-build state.

This works the first time and the wizard displays properly, but every subsequent time I rebuild the wizard and test it with the project template, it uses the first version. This still occurs even if I go into the GAC and manually remove it in between builds. The only way I can get a new result is by changing the version number referenced in the template and redeploying it (which is out of the question).

On a slightly related note, is there a way, be it through the .vsTemplate file or a wizard, to add files to an existing project in the solution? (ie, for an Asp.NET website, a project template would create a class library called "NewModule", as well as add NewModule.txt to the website's project).

Grid Commander
Jan 7, 2007

thank you mr. morrison
You need to remove it from the gac and then reboot your machine.

There is an internal tool at the place that I used to work at that accomplishes the removal from the dllcache without requiring a reboot. (It was a special version of the delete command) But, even that did not work all of the time. It only worked sporadically -- which of course sucks.

Rebooting your machine should cause the cache to flush and the deleted assembly to actually go away.

Sorry about this. I had to deal with it a lot at my old job, and there is really no good way around it (that I am aware of) outside of the hive.

Can you do a lot of the work without using gac, and then add the gac cache feature towards the end of development?

On another note, a good tip is to not sign your assemblies until close to the end of the development cycle too.

pliable
Sep 26, 2003

this is what u get for "180 x 180 avatars"

this is what u fucking get u bithc
Fun Shoe

Boogeyman posted:

Hopefully that helps a bit. Maybe some other people will chime in if there are better ways of doing this type of thing.

Fiend posted:

code:
    XmlDocument xld = new XmlDocument();
    xld.Load(@"C:\what.xml");
    Console.WriteLine(xld.SelectSingleNode("Application/LoanName").InnerText.ToString().ToString());

I think these would actually help very much. Thank you much gentlemen :).

MisterZimbu
Mar 13, 2006

Grid Commander posted:

You need to remove it from the gac and then reboot your machine.

There is an internal tool at the place that I used to work at that accomplishes the removal from the dllcache without requiring a reboot. (It was a special version of the delete command) But, even that did not work all of the time. It only worked sporadically -- which of course sucks.

Rebooting your machine should cause the cache to flush and the deleted assembly to actually go away.

Sorry about this. I had to deal with it a lot at my old job, and there is really no good way around it (that I am aware of) outside of the hive.

Can you do a lot of the work without using gac, and then add the gac cache feature towards the end of development?

On another note, a good tip is to not sign your assemblies until close to the end of the development cycle too.

Unfortunately, the VS2005 template engine seems to require a strongly named and signed assembly in the cache to run a custom wizard. I'm interpreting this as meaning that I have to sign it and add it to the cache each time I want to test a new build. I could be wrong about that (this is the first time I've worked with the GAC).

I'm thinking I'll have to write a quick program that will test the wizard for my internal builds and then hope that the wizard itself will work with the real template system.

Thanks for the help.

Boosh!
Apr 12, 2002
Oven Wrangler
ASP.Net newbie here. Is there a way, codewise, to force a print to the clientside LPT1 port, besides setting it as the default in Windows?

I just need to explore my options before going ahead with a small company project. Thanks.

Boosh! fucked around with this message at 21:14 on Jan 10, 2007

pig-fukr
Nov 3, 2002
Ok, here's a bizarre one...

Synopsis is I'm trying to return the current hostname given an ip.

I use this code to do so:

Dim HostEntry As IPHostEntry = Dns.GetHostByAddress(Request.UserHostAddress)
Response.Write(HostEntry.HostName)


When I do this locally all is well.

When I do this on production I get a completely and totally random hostname back.

The gently caress?

Fiend
Dec 2, 2001
I want something that will take an integer and return a fixed width string. The integer will always be between 1 - 9999 and the return string will always be 4 digits in length.

Ideally, when I pass "10" to the function, it should return "0010".

I can do something like this...
code:
static string fourDigits(int input, int len)
{
    string ret = input.ToString();
    while (ret.Length < len)
    {
        ret = "0" + ret;
    }
    return ret;
}
What is the best method of doing this? Is there a formatting command that I can use in ToString() like you would when you're formatting dates?
code:
Console.WriteLine(DateTime.Now.ToString("dddd 'the ' dd'" 
+ dateSuffix(dt.ToString("d")) 
+ " of ' MMMM ' in the year of our Lord ' yyyy gg");
Console.WriteLine(DateTime.Now.ToString("yyyy.MM.dd%-HH.mm.ss.fffffff tt (gg)"));

Fiend
Dec 2, 2001

pig-fukr posted:

Ok, here's a bizarre one...

Synopsis is I'm trying to return the current hostname given an ip.

I use this code to do so:

Dim HostEntry As IPHostEntry = Dns.GetHostByAddress(Request.UserHostAddress)
Response.Write(HostEntry.HostName)


When I do this locally all is well.

When I do this on production I get a completely and totally random hostname back.

The gently caress?
What do you mean by "locally" and "production"? Is the production machine a box with multiple ip addresses and multiple names?

pig-fukr
Nov 3, 2002

Fiend posted:

What do you mean by "locally" and "production"? Is the production machine a box with multiple ip addresses and multiple names?

"local" would be my personal machine that is nothing more then a workstation.

"Production" is a non-clustered asp.net 2.0 application on a web server with a single ip address servicing requests only on port 80 to that single address.

Both the "local" and "production" machines are on the same domain and subnet, as are the "remote" hosts that I am trying to resolve. The entire context of the website is an intranet site which is authenticated via AD.

Fiend
Dec 2, 2001

pig-fukr posted:

"local" would be my personal machine that is nothing more then a workstation.

"Production" is a non-clustered asp.net 2.0 application on a web server with a single ip address servicing requests only on port 80 to that single address.

Both the "local" and "production" machines are on the same domain and subnet, as are the "remote" hosts that I am trying to resolve. The entire context of the website is an intranet site which is authenticated via AD.

Do the return values imply that production and the workstation are using different DNS entries? Is there also a setting for doing reverse lookups, or am I thinking of something else?

Boogeyman
Sep 29, 2004

Boo, motherfucker.

Fiend posted:

What is the best method of doing this? Is there a formatting command that I can use in ToString() like you would when you're formatting dates?

Just tried this and it worked...

code:
3.ToString("0000")

pig-fukr
Nov 3, 2002

Fiend posted:

Do the return values imply that production and the workstation are using different DNS entries? Is there also a setting for doing reverse lookups, or am I thinking of something else?

Primary and secondary DNS servers are identicle for both machines, which is further infuriating.

I should also add that when I remote desktop into the webserver where the call is failing, I am able to ping my workstation by both IP and hostname. I'm stuck on how the server itself is able to resolve the correct hostname but code calling the same function on that server fails.

Fiend
Dec 2, 2001

Boogeyman posted:

Just tried this and it worked...

code:
3.ToString("0000")
Thank you!

Fiend
Dec 2, 2001

pig-fukr posted:

Primary and secondary DNS servers are identicle for both machines, which is further infuriating.

I should also add that when I remote desktop into the webserver where the call is failing, I am able to ping my workstation by both IP and hostname. I'm stuck on how the server itself is able to resolve the correct hostname but code calling the same function on that server fails.
I don't think both pieces use the same code.

pig-fukr
Nov 3, 2002

Fiend posted:

I don't think both pieces use the same code.

I don't know enough about how .NET does things to really argue the point. The machine itself seems to have a properly enough configured DNS resource that it can resolve the remote targets in question via command line.

Fiend
Dec 2, 2001

pig-fukr posted:

I don't know enough about how .NET does things to really argue the point. The machine itself seems to have a properly enough configured DNS resource that it can resolve the remote targets in question via command line.
I'd suggest trying to take that code snippet and into a console. Then on the ASP.NET sites on both the workstation and production, have it output the results of Request.UserHostAddress and see if there are any discrepencies. I'm taking a look at something on my end and will update when I get a chance :)

pliable
Sep 26, 2003

this is what u get for "180 x 180 avatars"

this is what u fucking get u bithc
Fun Shoe
What is the easiest way to copy files from a physical path on a hard drive to a SQL database? I'm very very new when it comes to SQL, and all the books I have tell how to upload them from an ASP FileUpload control, but not really from a physical path.

It can't be that hard, can it?

wwb
Aug 17, 2004

Something like:

code:
byte[] data=File.ReadAllBytes(fileName);
SqlParameter param=new SqlParameter();
param.Name="@Data";
param.DbType=SqlDbType.VarBinary;
param.Value=data;
cmd.Parameters.Add(param);
code written off cuff, probably does not work. In any case, what you want to do is to 1) Get the files in a byte array, probably using the handy new static functions in the File class.
2) Bind the byte array to a parameter.
3) Execute the command.

Heffer
May 1, 2003

pliable posted:

What is the easiest way to copy files from a physical path on a hard drive to a SQL database? I'm very very new when it comes to SQL, and all the books I have tell how to upload them from an ASP FileUpload control, but not really from a physical path.

It can't be that hard, can it?

Please don't put files in databases :(

If you do, learn how to put the binary data into seperate sql datafiles, and have the table put the data there.

Please :(

pliable
Sep 26, 2003

this is what u get for "180 x 180 avatars"

this is what u fucking get u bithc
Fun Shoe

wwb posted:

1) Get the files in a byte array, probably using the handy new static functions in the File class.
2) Bind the byte array to a parameter.
3) Execute the command.

Do you have AIM or something? You are like, a loving .Net God, and I'd appreciate your godly support in the future :) (plus I want to ask you more about this).

Heffer posted:

Please don't put files in databases :(

If you do, learn how to put the binary data into seperate sql datafiles, and have the table put the data there.

Please :(

It's not really my choice; this is what my boss and supervisor wants done. But what's wrong with putting files into a database? We're going to still keep the copy from the physical path, so.

SLOSifl
Aug 10, 2002


superb0wr posted:

Anybody know what those [SquareBracket] directives or whatever you can use in c# are called, and if its possible to write custom ones? Like [STAThread] or [WebMethod]?
I have an application that builds its entire inter-component communication system and most of the GUI from Attributes. Attributes are great because they describe your classes and objects without interfering with the code itself.

For example, I have a messaging system that verious components register with. In a simple example, say I have a class that wants to know when a Customer is added to the transaction so it can update its display.
code:
[MessageHandlerMethod ("Customer.Add")]
public void CustomerHandler ( string message, object parameter ) {
   Customer cust = parameter as Customer;

   this.CustomerDisplay.Text = cust != null ? cust.FullName : "No Customer";
}
I just write the function and tack that attribute on, and that's it from my end. If I want to also handle the "Customer.Remove" message, I can add that attribute on as well. My particular custom attribute allows multiple instances per object, and can only be applied to methods. Interestingly enough, this information is provided by an attribute as well.
code:
[AttributeUsage ( AttributeTargets.Method, Inherited = true, AllowMultiple = true )]
public class MessageHandlerMethod : System.Attribute {
// ... 
}
When I extract the Message Handlers from an object, I'm actually looking at its type, not the instance of the class. It's very simple to process.
code:
// Get the Type of the object
Type type = someObject.GetType ();

// Grab all the methods contained in the Type. (Inheritance is taken care of by default)
MethodInfo[] methods = type.GetMethods ();

// Loop through the methods and take a look at the attributes
foreach ( MethodInfo method in methods ) {
   // And grab the custom attribute I created
   object[] attributes = method.GetCustomAttributes ( typeof ( MessageHandlerMethod), true );
   
   // Loop through those and register them
   foreach( MessageHandlerMethod mhm in attributes ) {
      // Add a custom class that holds the object, the method, 
      // and any other status to a collection for later access
   }
}
Attributes are great.

My UI works this way too. Any object can describe itself visually, providing colors, images, custom formatting text, positioning info, special conditions, font appearance...pretty much everything for any or all properties it contains. I have a UI control that reads in the layout info and displays it on the screen. This means that the "Customer" you see on the screen and the completely non-UI related Customer class that represents a row in a Customer table are basically the same thing. There are no "CustomerName" or "Age" textboxes. The UI Control you see was written before the Customer class ever exisited and the customer class contains all the information required to get it on the screen.

I don't know if you needed any of that information but I found attributes to be great for writing classes that describe themselves in a number of useful ways.

(You should see the Transaction object - it is a single class that can be displayed on the screen to give you Totals, Tax Info, item counts, amount due, etc, and also handles sending and receiving of enough messages to basically handle all the details of a sales transaction. Yet nothing outside of that single class even knows it exists)

Victor
Jun 18, 2004

Heffer posted:

If you do, learn how to put the binary data into seperate sql datafiles, and have the table put the data there.
If you script the table, you can use the textimage_on keyword to do this. You can do it from Enterprise Manager by going to table design, then table properties, and change the "Text Filegroup", which is actually the text/image filegroup, and hopefully you're storing files as text or binary, depending on which they are.

Heffer
May 1, 2003

pliable posted:

Do you have AIM or something? You are like, a loving .Net God, and I'd appreciate your godly support in the future :) (plus I want to ask you more about this).


It's not really my choice; this is what my boss and supervisor wants done. But what's wrong with putting files into a database? We're going to still keep the copy from the physical path, so.

Here's example #1 of how things could go wrong. Say you have a table that contains a field for an ID number (2 bytes) a date (8 bytes) and the file itself (32,000 bytes). The rows for the table ordinarily get stored consecutively on the disk, and the database only keeps track of where the first row is, apart from indexes and such.

You want to do a simple thing, like get the file that was uploaded at a specific date. The database reads the first chunk of the table at 64KB per read. The first read gets it two rows to check. Neither match. It goes back to the disk and reads the next 64K. Neither of the new ones match. It does this for 1000 times. It's read 64 megabytes of your disk, looking for a single 32K file out of two thousand.

If you had done this by storing the 240 character filename instead of the actual file, you read 2000 * 250 = 500KB, which only takes 8 read operations instead of 1000.

Here's example #2 of how things can go wrong. You have a database for your family photo album. Your sister, mother, father, and cousins can all log in and upload and downlaod photos. You have several people viewing files from the database at one point, each one requiring one database call, and about 500K per database IO operation, with multiple files viewed on one page.

You end up with a database that is 0.1% data and 99.9% files. With all this responsibility, your database gets swamped with pushing in and out gigabytes of files day in and day out. Little queries like validating passwords get drowned out because your database is so busy acting as a fileserver.

Now, there are cases where it's sensible to have files in a database. Basically where you A) Have serious transactional, versioning, accuracy, and safeguarding needs and you can afford the pain and torment of having files stuffed into a database, and B) Where you're doing in-database searching and indexing of the documents, such as for full text queries.

Everywhere else, it makes sense to store the file with a file system.

(The textimage stuff Victor was talking about allows you to avoid some of the penalties of storing large blocks of binary data in the database, but not all)

pliable
Sep 26, 2003

this is what u get for "180 x 180 avatars"

this is what u fucking get u bithc
Fun Shoe

Heffer posted:

Basically where you A) Have serious transactional, versioning, accuracy, and safeguarding needs and you can afford the pain and torment of having files stuffed into a database...

This is pretty much the reason why I'm storing files into the database. It's sensitive data, so it needs good safeguarding (despite the amount of safeguards we already have).

As for getting the file, I'm storing both the file name and the file itself in the same table, so I don't think that should be an issue (hopefully). And as for traffic concerns, that's not really an issue either, as there won't be lots of traffic going on.

But...I'll definitely keep what you said in mind if I create a database for myself in the future. Thanks :).

wwb
Aug 17, 2004

I have yet to manage to melt down a SQL server because it was serving files out of the database, but that is me.

Anyhow, almost invariably, I tend to de-normalize a bit and setup a separate files table, which is effectively joined at the hip to the metadata table. This avoids ever hitting the file data except when you explicitly need the file data, while still keeping everything in the db.

As for me, I don't really do IM. Especially since my main computer just died and I am sitting here setting up a replacement. Do feel free to post here, it is usually better to answer questions where others can get the benefit of the question and the answer. I do tend to keep a pretty good eye on this thread.

PS: SLOSifl, that is some pretty slick stuff.

wwb fucked around with this message at 23:04 on Jan 11, 2007

The Noble Nobbler
Jul 14, 2003
Comments on NetTiers, anyone?

http://www.nettiers.com

From the site:

netTiers is a set of open source code generation templates that simplify the tasks of creating customized Application Tiers for your Microsoft.Net applications in just a few minutes.

.netTiers utilizes the power of the best code generation tool available today, CodeSmith Tools. .netTiers generated architecture is custom to your domain, uses familiar patterns, and follows the guidance of Microsoft's recommended patterns and practices. In fact, the .netTiers base architecture is built upon the Microsoft Enterprise Library Application Blocks. Oh right, .netTiers is FREE!

The Noble Nobbler fucked around with this message at 23:10 on Jan 11, 2007

Adbot
ADBOT LOVES YOU

Fiend
Dec 2, 2001
Having an issue with this code on one of two XP machines, both with the same config:
code:
// Throws the error "Object Reference not set to an instance of an object"
string sUrl = Request.Url.ToString();
This is in the BeginRequest handler in Global.asax

  • Locked thread