I will try the link this weekend. And thank you very much for your kind help.
I was looking your snipset and seems that is what I am looking for. I will
try this weekend and see what I can come up to. I also find word pad like
Thank you for your kind help. I will send my post after weekend.
"Rohit" wrote:
> Hi
> you can format the file into a binary form. Something by this way..
>
> (...)
> string sqlInsert = "INSERT INTO o_Documents (fileName, fileContent)
> VALUES (@fileName, @fileContent)";
> SqlCommand cmdInsert = new SqlCommand(sqlInsert, sqlDBConn);
> (...)
> //read full file content into memory
> FileStream fs = new FileStream(theFile.FullName, FileMode.Open,
> FileAccess.Read);
> BinaryReader r = new BinaryReader(fs);
> byte[] bytes = new byte[fs.Length];
> for( long i = 0; i < fs.Length; i++)
> {
> bytes[i] = r.ReadByte();
> }
> r.Close();
> fs.Close();
> (...)
> SqlParameter paramFileContent = new SqlParameter("@fileContent",
> SqlDbType.VarBinary);
> paramFileContent.Direction = ParameterDirection.Input;
> paramFileContent.Size = 2147483647;
> paramFileContent.Value = bytes;
>
> cmdInsert.Parameters.Add(paramFileName);
> cmdInsert.Parameters.Add(paramFileContent);
> cmdInsert.ExecuteNonQuery();
>
> Do store the file name and type. This will help you retrived the file.
> The field where the file content is to be stored is of type "Image"
> Other thing is you can save the file in a folder in the server and
> later retirve the file from that path. (That's a risk). I have not
> tried doing this for all the file types but only text file. U can try
> this
>
> Hope this helps you let me know.
>
>
> Uri Dimant wrote:
> > Hi
> >
http://www.aspfaq.com/show.asp?id=2149 > >
> >
> >
> >
> > "Niyazi" <Niyazi@discussions.microsoft.com> wrote in message
> > news:F84CB5C2-AB67-4AC3-A54C-358A9B1F3CDB@microsoft.com...
> > > Hi,
> > > I am developing small insurance application using VB.NET and SQL server
> > > 2000.
> > > My tables in SQL server are:
> > >
> > > tbl_Customer (stores the custmer information)
> > > tbl_CustImage (stores the customer picture and signature)
> > > tbl_InsuranceCompanies (stores the Insurance companies information)
> > > tbl_InsuranceType (stores the insurance type)
> > >
> > >
> > > tbl_LifeInsurance (stores the LifeInsurance information)
> > > tbl_FireQuakeInsurance (stores the FireQuakeInsuranceinformation)
> > > tbl_CarInsurance (stores the LifeInsurance information)
> > >
> > >
> > > tbl_BLOBCustomer (store with CustomerID for Document)
> > > tbl_BLOBLIFEInsurance (store with LIFEInsuranceID for Document)
> > > tbl_BLOBFIREQUAKEInsurance (store with FQInsuranceID for Document)
> > > tbl_BLOBCARInsurance (store with CARInsuranceID for Document)
> > >
> > > --------------------------------------------------------------------------------
> > >
> > > If the Insurance is going to renewed move old data into below table
> > >
> > > tbl_OLDLIFEInsurance (store with new ID)
> > > tbl_OLDFIREInsurance (store with new ID)
> > > tbl_OLDCARInsurance (store with new ID)
> > >
> > > ----------------------------------------------------------------------------------
> > >
> > > My question is that when the Insurance going to be renew I need to move
> > > old
> > > data in old.... tables and replace the data for the Insurance that going
> > > to
> > > be renewed using InsurancePolicyID as ID.
> > >
> > > Doing things like in above are correct or not?
> > > And secondly how do I store Word Document or Excel file into SQL server
> > > 2000
> > > and later retrive for editinig and restore the documents or excel files?
> > >
> > > Thank you very much for your kind understanding for reading my post.
> > >
> > > Rgds
> > > Niyazi
>