111,094
社区成员




#region 获取数据以保存入数据库
byte[] bWrite = System.Text.Encoding.Default.GetBytes(this.rtbContent.Rtf); //rtbContent是RichTextBox
InfoCenterModel model = new InfoCenterModel();
model.Author = AccountNo;
model.Title = txtTitle.Text;
model.BigType = cboMEA.Text.Trim();
model.SmallType = cboTypeDetail.Text.Trim();
model.Content = bWrite;
model.Sourse = txtSourse.Text.Trim();
m_proxy.AddInfo(model);
#endregion
#region 读取数据以显示
DataTable dt = null ;
dt = m_proxy.QueryInfo();
byte[] b = (byte[])dt.Rows[0]["Content"];
string s = System.Text.Encoding.Default.GetString(b, 0, b.Length);
this.rtbContent.Rtf = @s;
#endregion
m_proxy.QueryInfo();
这是什么呢?
m_proxy.QueryInfo()
QueryInfo()
{
string Sqlstring = "select top 1 Id,Title,Author,Content,ReleaseTime from infocenter order by ReleaseTime Desc ";
return SQLHelper.QueryReturnTable(connectionString, Sqlstring).Tables[0];
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace = "http://SunkeSoft.Com.SunkeTrader/2010/01", ConfigurationName = "DataExchangeContract")]
public interface DataExchangeContract
{
[System.ServiceModel.OperationContractAttribute(Action = "http://SunkeSoft.Com.SunkeTrader/2010/01/DataExchangeContract/QueryInfo", ReplyAction = "http://SunkeSoft.Com.SunkeTrader/2010/01/DataExchangeContract/QueryInfoResponse")]
DataTable QueryInfo();
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
public partial class DataExchangeContractClient : System.ServiceModel.ClientBase<DataExchangeContract>, DataExchangeContract
{
public DataExchangeContractClient()
{
}
public DataExchangeContractClient(string endpointConfigurationName) :
base(endpointConfigurationName)
{
}
public DataExchangeContractClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
public DataExchangeContractClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}
public DataExchangeContractClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}
public DataTable QueryInfo()
{
return base.Channel.QueryInfo();
}
}