在C#中,可以通过如下的步骤来实现将p_w_picpath文件写入数据表的p_w_picpath字段:  
  1,创建一个FileStream对象,通过该FileStream对象来读取指定的p_w_picpath文件;  
  2,根据生成FileStream对象,创建byte[]数据,通过FileStream对象的Read方法将数据写入byte[]数组中;  
  3,将上述byte[]数组赋予数据表的p_w_picpath字段,写入数据表中;  
  关于将数据表中的iamge字段显示在PictureBox控件中,请参考如下答复:  
  http://www.csdn.net/expert/topic/675/675865.xml?temp=.655163  
    
  下面提供一段示例程序,供您参考:  
 

 
  
  1. 在C#中,可以通过如下的步骤来实现将p_w_picpath文件写入数据表的p_w_picpath字段:     
  2.   1,创建一个FileStream对象,通过该FileStream对象来读取指定的p_w_picpath文件;     
  3.   2,根据生成FileStream对象,创建byte[]数据,通过FileStream对象的Read方法将数据写入byte[]数组中;     
  4.   3,将上述byte[]数组赋予数据表的p_w_picpath字段,写入数据表中;     
  5.   关于将数据表中的iamge字段显示在PictureBox控件中,请参考如下答复:     
  6.   http://www.csdn.net/expert/topic/675/675865.xml?temp=.655163     
  7.        
  8.   下面提供一段示例程序,供您参考:     
  9.   private   void   btnAdd_Click(object   sender,   System.EventArgs   e)     
  10.   {     
  11.   //     Fill   a   DataSet     
  12.   DataSet   ds   =   new   DataSet();     
  13.   string   connString   =   "Server=SHA-RICKIE-01;DataBase=test;uid=user;pwd=user";     
  14.   string   sqlString   =   "Select   *   from   Students";     
  15.   SqlConnection   conn   =   new   SqlConnection(connString);     
  16.   conn.Open();     
  17.   SqlDataAdapter   sqlDataAdapter1   =   new   SqlDataAdapter(sqlString,conn);     
  18.   SqlCommandBuilder   MyCB   =   new   SqlCommandBuilder(sqlDataAdapter1);     
  19.        
  20.   sqlDataAdapter1.Fill(ds,   "students");     
  21.   DataTable   TheTable   =   ds.Tables[0];     
  22.   //   Create   a   new   row   in   Memory       
  23.   DataRow   aRow   =   TheTable.NewRow();     
  24.   //   Insert   the   information   from   the   dialog   into   the   Table       
  25.   aRow["name"]   =   txtboxname.Text;     
  26.   aRow["age"]   =   txtboxage.Text;     
  27.   //   创建一个FileStream对象用来读取p_w_picpath文件,其中FileName   为该p_w_picpath的完整文件名         
  28.   string   FileName   =   txtboxFilename.Text;     
  29.   FileStream   fs   =   new   FileStream   (FileName,   FileMode.OpenOrCreate,     
  30.   FileAccess.Read);     
  31.   //   Read   the   Data   into   the   Byte   Array     
  32.   byte[]   MyData   =   new   byte[fs.Length];     
  33.   fs.Read(MyData,   0,   (int)fs.Length);     
  34.   fs.Close();     
  35.   //   Assign   the   DataRow   Picture   Column   to   the   Byte   Array   to   populate   it   in   the   DataRow     
  36.   aRow["p_w_picpath"]   =   MyData;     
  37.   //   Add   the   DataRow   to   the   DataTable     
  38.   TheTable.Rows.Add(aRow);     
  39.   //   写数据记录到数据库表中     
  40.   sqlDataAdapter1.Update(ds,   "students");     
  41.   MessageBox.Show("A   student   added.");     
  42.   }     

 关于FileStream类的更详细信息,请参考MSDN:  
  ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemIOFileStreamMembersTopic.htm