我正在使用MySQL.这是我的表
supplier_ID Item_ID Date Price QTY
1 1 2012-01-01 00:00:00 500.00 2
1 1 2012-01-03 00:00:00 450.00 10
2 1 2012-01-01 00:00:00 400.00 5
3 1 2012-05-01 00:00:00 500.00 1
Run Code Online (Sandbox Code Playgroud)
我需要一个显示像这样的表的选择查询.
supplier_ID 2012-01-01 2012-01-03 2012-05-01
1 500.00(2) 450.00(10) null
2 400.00(5) null null
3 null null 500.00(1)
Run Code Online (Sandbox Code Playgroud) 我是ASP.NET的新手.每次我尝试运行我的应用程序时,都会遇到下面的错误消息.我已经多次为MySQL安装.Net Framework Data Provider.我希望有人可以帮助我.提前致谢.
Server Error in '/PLDT QuickSearcher' Application.
Unable to find the requested .Net Framework Data Provider. It may not be installed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.
Run Code Online (Sandbox Code Playgroud) 我想为数据库中的整个表显示DataDictionary.
SHOW COLUMNS
FROM `MyDataBase`.`MyTables`
WHERE IN ( SELECT TABLE_NAME
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = 'MyDataBase'
);
Run Code Online (Sandbox Code Playgroud)
我可以使用这样的查询吗?我想使用单个查询查看整个列数据
我正在尝试在Button_Click事件上传递两个值
public MyClass()
{
Int64 po = 123456;
foreach (Expense expense in pr.Expenses)
{
Button btnExpenseDetail = new Button();
btnExpenseDetail.Text = expense.ExpenseName;
btnExpenseDetail.Location = new Point(startLocation.X + 410, startLocation.Y + (23 *
btnExpenseDetail.Click += (sender, e) => { MyHandler(sender, e, po , expense.ExpenseName); };
pnlProjectSummary_Expenses.Controls.Add(btnExpenseDetail);
}
}
void MyHandler(object sender, EventArgs e, string po, string category)
{
FormExpenseDetails ed = new FormExpenseDetails(po, category);
ed.Show();
}
Run Code Online (Sandbox Code Playgroud)
我正在使用visual studio 2010 c#.在面板上,每个Button的文本值都是不同的.但按钮'Click_Events的行为完全相同.有人能告诉我哪部分代码我得到这个逻辑错误?
================================================== ======================
每次用户都会添加,删除或编辑数据.我想保留它的记录.所以系统管理员可以看看以后谁做了什么.
例如
private AddUser(User id)
{
if(id != null)
{
MessageBox.Show("Item Updated");
string sqlAddUser = "INSERT INTO 'DATABASE.USER' VALUES (Item.ID, Item.Name, Item.Address)";
if(db.SqlNonQuery(sqlAddUser) //If successful
{
///To DO : Add system log into database
///Ex. string sqlLog = DateTime.Now + User.ID + " added Item ID " + item.ID;
}
else
{
MessageBox.Show("Error");
}
}
}
Run Code Online (Sandbox Code Playgroud)
有没有更好的方法或常规做法呢?谢谢.