所以我在DbPOS中遇到问题, 它有这个错误,说
无法隐式转换类型'字符串' to' namespace.class'在哪里 namespace.Class是我的产品类(对象构造函数)
DbPOS(部分):
DataTable table = new DataTable();
DataRow row;
conn.Open();
da.Fill(table);
int nProducts = table.Rows.Count;
products = new product[nProducts];
for (int i = 0; i < nProducts; i++)
{
row = table.Rows[i];
pdname = row["name"].ToString();
product p = new product(pdname);
p.PDname = pdname;
products[i] = pdname;
//products[i]=pdname; pdname above has the error
}
产品类:
class product
{
public string pdname;
public product()
{
pdname = "unknown";
}
public product(string pdname)
{
this.pdname = pdname;
}
public string PDname
{
get { return this.pdname; }
set { this.pdname = value; }
}
}
答案 0 :(得分:0)
试试这个:
Set-Date -Date "2015-11-04 (Get-Date).ToShortTimeString()"