Databases Reference
In-Depth Information
How It Works
You simply load the source code for the LoadText program:
static string fileName =
@"C:\Documents and Settings\Administrator\My Documents\"
+ @"Visual Studio Codename Orcas\Projects\Chapter18\LoadText\LoadText.cs";
into a table:
cmd.CommandText = @"
insert into texttable
values (@textfile, @textdata)
";
cmd.Parameters.Add("@textfile", SqlDbType.NVarChar, 30);
// the image gets stored in the form of of an Image string.
// figure 1000000 specifies the bytes for the amount to
// specify the size of the Image string.
cmd.Parameters.Add("@textdata", SqlDbType.Text, 1000000);
that you created in the temporary database:
ExecuteCommand(@"
if exists
(
select
*
from
information_schema.tables
where
table_name = 'texttable'
)
drop table texttable
");
ExecuteCommand(@"
create table texttable
(
textfile varchar(255),
textdata varchar(max)
)
");
Search WWH ::




Custom Search