• 大小: 1.47MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-31
  • 语言: 数据库
  • 标签:

资源简介

通讯录_SQLServer版 通讯录_SQLServer版 通讯录_SQLServer版

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;

namespace 通讯录
{
    public partial class AddNewContactForm : ContactForm
    {
        public AddNewContactForm()
        {
            InitializeComponent();
        }

        private void btnSaveContact_Click(object sender EventArgs e)
        {
            string selectCommandText=“select * from Contact“;
           // string updateCommandText = “update Contact set contactImage=@Image where contactQqNumber=‘“ + this.tempQqNumber + “‘“;
            SqlConnection con = Database.CreateConnection();
            con.Open();
            SqlDataAdapter dtAdapter = new SqlDataAdapter(selectCommandText con);
            SqlCommandBuilder cmdBuilder = new SqlCommandBuilder(dtAdapter);
            DataSet dtSet=new DataSet();        
            dtAdapter.Fill(dtSet “Contact“);
            DataRow dtRow = dtSet.Tables[“Contact“].NewRow();
            if (strPicturePath != null)
            {
                FileStream stream = new FileStream(strPicturePath FileMode.Open FileAccess.Read);
                long picLength = stream.Length;
                byte[] buffer = new byte[(int)picLength];
                stream.Read(buffer 0 (int)picLength);
                dtRow[“contactImage“] = buffer;
                //dtAdapter.UpdateCommand = new SqlCommand(updateCommandText con);
                //dtAdapter.UpdateCommand.Parameters.Add(“@Image“ SqlDbType.Image);
                //dtAdapter.UpdateCommand.Parameters[“@Image“].Value = buffer;
                //dtAdapter.UpdateCommand.ExecuteNonQuery();               
            }     
            dtRow[“contactAcademyName“] = this.txtAcademyName.Text;
            dtRow[“contactClass“] = this.txtClass.Text;
            dtRow[“contactName“] = this.txtContactName.Text;
            dtRow[“contactEmail“] = this.txtEmail.Text;
            dtRow[“contactGrade“] = this.txtGrade.Text;
            dtRow[“contactAddress“] = this.txtHomeAddress.Text;
            dtRow[“contactMobileNumber“] = this.txtMobilePhoneNumber.Text;
            dtRow[“contactQqNumber“] = this.txtQqNumber.Text;
            dtRow[“contactSchoolName“] = this.txtSchoolName.Text;
            dtRow[“contactTelephoneNumber“] = this.txtTelephoneNumber.Text;
            dtRow[“contactBlessingWords“] = this.richTxtBlessingWords.Text;
            dtRow[“contactID“] = dtSet.Tables[“Contact“].Rows.Count;
            dtSet.Tables[“Contact“].Rows.Add(dtRow);
            dtAdapter.Update(dtSet “Contact“);
            con.Close();
            MessageBox.Show(“保存成功!“ “提示“ MessageBoxButtons.OK);
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1345  2009-07-03 03:57  通讯录_SQLServer版\ContactsInfo.sql

     文件     569501  2009-12-25 13:26  通讯录_SQLServer版\Readme.docx

     文件       2841  2009-07-04 03:15  通讯录_SQLServer版\通讯录\AddNewContactForm.cs

     文件       4442  2009-07-04 02:00  通讯录_SQLServer版\通讯录\AddNewContactForm.Designer.cs

     文件       5814  2009-07-04 02:00  通讯录_SQLServer版\通讯录\AddNewContactForm.resx

     文件       5632  2005-11-11 22:25  通讯录_SQLServer版\通讯录\bin\Debug\通讯录.vshost.exe

     文件       2610  2009-07-04 02:24  通讯录_SQLServer版\通讯录\ContactForm.cs

     文件      21540  2009-07-03 06:04  通讯录_SQLServer版\通讯录\ContactForm.Designer.cs

     文件     178997  2009-06-29 17:09  通讯录_SQLServer版\通讯录\ContactForm.resx

     文件       1753  2009-07-02 00:42  通讯录_SQLServer版\通讯录\Database.cs

     文件       4771  2009-07-04 03:18  通讯录_SQLServer版\通讯录\EditContactForm.cs

     文件       4436  2009-07-04 02:00  通讯录_SQLServer版\通讯录\EditContactForm.Designer.cs

     文件       5814  2009-07-04 02:00  通讯录_SQLServer版\通讯录\EditContactForm.resx

     文件        335  2009-07-04 03:48  通讯录_SQLServer版\通讯录\Help.cs

     文件       2474  2009-07-04 03:48  通讯录_SQLServer版\通讯录\Help.Designer.cs

     文件       6591  2009-07-04 03:48  通讯录_SQLServer版\通讯录\Help.resx

     文件       3587  2009-07-01 20:57  通讯录_SQLServer版\通讯录\ListViewColumnSorter.cs

     文件        889  2009-06-29 17:07  通讯录_SQLServer版\通讯录\LoginForm.cs

     文件       6986  2009-06-29 17:07  通讯录_SQLServer版\通讯录\LoginForm.Designer.cs

     文件       5987  2009-06-29 17:07  通讯录_SQLServer版\通讯录\LoginForm.resx

     文件       2284  2009-07-04 04:49  通讯录_SQLServer版\通讯录\MainForm.cs

     文件       8876  2009-07-04 04:49  通讯录_SQLServer版\通讯录\MainForm.Designer.cs

     文件       6192  2009-07-04 04:49  通讯录_SQLServer版\通讯录\MainForm.resx

     文件      40960  2005-03-14 15:54  通讯录_SQLServer版\通讯录\MyListView.dll

     文件      23267  2009-07-04 04:18  通讯录_SQLServer版\通讯录\PrintListView.cs

     文件       1166  2009-06-27 16:44  通讯录_SQLServer版\通讯录\Properties\AssemblyInfo.cs

     文件       4112  2009-07-01 19:39  通讯录_SQLServer版\通讯录\Properties\Resources.Designer.cs

     文件       7181  2009-06-29 16:57  通讯录_SQLServer版\通讯录\Properties\Resources.resx

     文件       1105  2009-07-01 19:39  通讯录_SQLServer版\通讯录\Properties\Settings.Designer.cs

     文件        249  2009-06-27 16:44  通讯录_SQLServer版\通讯录\Properties\Settings.settings

............此处省略38个文件信息

评论

共有 条评论

相关资源