I'm creating a web site and I store some SQL script in .SQL file.
Now I would like to read this file.
In an ordinary (desktop) application, I'm used to simply embed them in the assembly and get a stream to them with:
string GetEmbededText(string name)
{
Type t = GetType();
using (Stream s = t.Assembly.GetManifestResourceStream(t, name))
return new StreamReader(s).ReadToEnd();
}
How could I achieve similar result in ASP.NET?
Lloyd Dupont - 19 Feb 2006 04:53 GMT
I just end up putting my file in ~/App_GlobaResources
I'm creating a web site and I store some SQL script in .SQL file.
Now I would like to read this file.
In an ordinary (desktop) application, I'm used to simply embed them in the assembly and get a stream to them with:
string GetEmbededText(string name)
{
Type t = GetType();
using (Stream s = t.Assembly.GetManifestResourceStream(t, name))
return new StreamReader(s).ReadToEnd();
}
How could I achieve similar result in ASP.NET?