我有一个数据网格视图有4列,前两列是组合框列,第三列是文本框列,第四列是按钮列.在表单加载我必须禁用datagrid的整个按钮列,在此之后我应该选择前三列和保存后,将这三个列保存在数据库中,特定行中的按钮列应该启用.应该通过单击按钮将第一列保存在数据库中.请帮助我解决这个问题很多天这里是我使用的代码
private void SATAddTemplate_Load(object sender, EventArgs e)
{
foreach (DataGridViewRow row in datagrdADDTEMP.Rows)
{
DataGridViewButtonCell btn = (DataGridViewButtonCell)row.Cells[3];
btn.ReadOnly = true;
}
}
private void btnSaveSettings_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow row in datagrdADDTEMP.Rows)
{
DataGridViewButtonCell btn = (DataGridViewButtonCell)row.Cells[3];
btn.ReadOnly = false;
}
}
Run Code Online (Sandbox Code Playgroud) 在我的Web应用程序中,我正在尝试创建用于记录错误和异常的日志文件,但是当我运行应用程序时,日志文件未在我的解决方案文件夹或bin文件夹中创建.
我使用了以下代码.请帮帮我,我遇到了这个问题,提前谢谢你.
使用的命名空间
using Microsoft.Practices.EnterpriseLibrary.Logging;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
Run Code Online (Sandbox Code Playgroud)
.cs文件
public int GetdeskKMasterRecordsCount(string CircleId, string StoreId)
{
try
{
throw new Exception("this is normal exception");
}
catch (Exception ex)
{
BindLog(ex);
return 0;
}
}
public static void BindLog(Exception ex)
{
if (ex == null) return;
Logger.Write(LogInformation(1, DateTime.Now, ex.Message, " "));
}
public static LogEntry LogInformation(int eventId, DateTime timeStamp, string message, string documentName)
{
LogEntry logEntryObject = new LogEntry();
logEntryObject.EventId = eventId;
logEntryObject.Title = documentName;
logEntryObject.TimeStamp = timeStamp;
logEntryObject.MachineName = System.Environment.MachineName;
logEntryObject.Message …Run Code Online (Sandbox Code Playgroud) 我收到以下错误.我用Google搜索了一天多,但我找不到确切的解决方案,请帮帮我谢谢
错误:无法隐式转换
System.Collections.Generic.List<System.Collections.Generic.IEnumerable<ADCO.eJMC.EntityDataModel.ShareholderUser>>为System.Collections.Generic.List<ADCO.eJMC.EntityDataModel.ShareholderUser>
我使用了以下代码
List<ShareholderUser> list = new List<ShareholderUser>();
list = dataContext.EJMCShareholderApprovals
.Include(s => s.Shareholder.ShareholderUsers)
.Where(e => e.EJMCRequestId == requestId)
.Select(s => s.Shareholder.ShareholderUsers
.Where(x => x.AccessMode == true))
.ToList();
Run Code Online (Sandbox Code Playgroud)