有些属性不知道怎么重写 还忘大大们赐教!
我想重写这些属性 重新设置默认值
DataGridView.AutoSizeRowsMode
DataGridView.RowTemplate.ReadOnly
高手都站出来指定下新人吧~
5 个解决方案
#1
重新设置值就在构造函数里赋值呗?
#2
可不可以重写这个属性 GET SET 设置默认值啊 大哥
#3
DataColumn[] keys=new DataColumn[1];
keys[0]=dataSet1.Tables["tblEmployee"].Columns["LoginName"];
dataSet1.Tables["tblEmployee"].PrimaryKey=keys;
DataRow findRow=dataSet1.Tables["tblEmployee"].Rows.Find(LoginName);
byte[] password=(findRow["Password"] == DBNull.Value)? null : (byte[])findRow["Password"];
byte[] password1=Encoding.Default .GetBytes (Password);
if( password==password1)
{
MessageBox.Show ("right","");
return true;
}
else
{
MessageBox.Show ("wrong","");
return false;
}
为什么总是wrong ,密码输入的是对的,比对有错误码?
keys[0]=dataSet1.Tables["tblEmployee"].Columns["LoginName"];
dataSet1.Tables["tblEmployee"].PrimaryKey=keys;
DataRow findRow=dataSet1.Tables["tblEmployee"].Rows.Find(LoginName);
byte[] password=(findRow["Password"] == DBNull.Value)? null : (byte[])findRow["Password"];
byte[] password1=Encoding.Default .GetBytes (Password);
if( password==password1)
{
MessageBox.Show ("right","");
return true;
}
else
{
MessageBox.Show ("wrong","");
return false;
}
为什么总是wrong ,密码输入的是对的,比对有错误码?
#4
DataColumn[] keys=new DataColumn[1];
keys[0]=dataSet1.Tables["tblEmployee"].Columns["LoginName"];
dataSet1.Tables["tblEmployee"].PrimaryKey=keys;
DataRow findRow=dataSet1.Tables["tblEmployee"].Rows.Find(LoginName);
byte[] password=(findRow["Password"] == DBNull.Value)? null : (byte[])findRow["Password"];
byte[] password1=Encoding.Default .GetBytes (Password);
if( password==password1)
{
MessageBox.Show ("right","");
return true;
}
else
{
MessageBox.Show ("wrong","");
return false;
}
帮忙看一下, 为什么总是wrong ,密码也是byte[]类型,密码输入的是对的,比对有错误码?
keys[0]=dataSet1.Tables["tblEmployee"].Columns["LoginName"];
dataSet1.Tables["tblEmployee"].PrimaryKey=keys;
DataRow findRow=dataSet1.Tables["tblEmployee"].Rows.Find(LoginName);
byte[] password=(findRow["Password"] == DBNull.Value)? null : (byte[])findRow["Password"];
byte[] password1=Encoding.Default .GetBytes (Password);
if( password==password1)
{
MessageBox.Show ("right","");
return true;
}
else
{
MessageBox.Show ("wrong","");
return false;
}
帮忙看一下, 为什么总是wrong ,密码也是byte[]类型,密码输入的是对的,比对有错误码?
#5
写在构造函数里:
public DataGridView() : base()
{
this.AutoSizeRowsMode = true;
}
public DataGridView() : base()
{
this.AutoSizeRowsMode = true;
}
#1
重新设置值就在构造函数里赋值呗?
#2
可不可以重写这个属性 GET SET 设置默认值啊 大哥
#3
DataColumn[] keys=new DataColumn[1];
keys[0]=dataSet1.Tables["tblEmployee"].Columns["LoginName"];
dataSet1.Tables["tblEmployee"].PrimaryKey=keys;
DataRow findRow=dataSet1.Tables["tblEmployee"].Rows.Find(LoginName);
byte[] password=(findRow["Password"] == DBNull.Value)? null : (byte[])findRow["Password"];
byte[] password1=Encoding.Default .GetBytes (Password);
if( password==password1)
{
MessageBox.Show ("right","");
return true;
}
else
{
MessageBox.Show ("wrong","");
return false;
}
为什么总是wrong ,密码输入的是对的,比对有错误码?
keys[0]=dataSet1.Tables["tblEmployee"].Columns["LoginName"];
dataSet1.Tables["tblEmployee"].PrimaryKey=keys;
DataRow findRow=dataSet1.Tables["tblEmployee"].Rows.Find(LoginName);
byte[] password=(findRow["Password"] == DBNull.Value)? null : (byte[])findRow["Password"];
byte[] password1=Encoding.Default .GetBytes (Password);
if( password==password1)
{
MessageBox.Show ("right","");
return true;
}
else
{
MessageBox.Show ("wrong","");
return false;
}
为什么总是wrong ,密码输入的是对的,比对有错误码?
#4
DataColumn[] keys=new DataColumn[1];
keys[0]=dataSet1.Tables["tblEmployee"].Columns["LoginName"];
dataSet1.Tables["tblEmployee"].PrimaryKey=keys;
DataRow findRow=dataSet1.Tables["tblEmployee"].Rows.Find(LoginName);
byte[] password=(findRow["Password"] == DBNull.Value)? null : (byte[])findRow["Password"];
byte[] password1=Encoding.Default .GetBytes (Password);
if( password==password1)
{
MessageBox.Show ("right","");
return true;
}
else
{
MessageBox.Show ("wrong","");
return false;
}
帮忙看一下, 为什么总是wrong ,密码也是byte[]类型,密码输入的是对的,比对有错误码?
keys[0]=dataSet1.Tables["tblEmployee"].Columns["LoginName"];
dataSet1.Tables["tblEmployee"].PrimaryKey=keys;
DataRow findRow=dataSet1.Tables["tblEmployee"].Rows.Find(LoginName);
byte[] password=(findRow["Password"] == DBNull.Value)? null : (byte[])findRow["Password"];
byte[] password1=Encoding.Default .GetBytes (Password);
if( password==password1)
{
MessageBox.Show ("right","");
return true;
}
else
{
MessageBox.Show ("wrong","");
return false;
}
帮忙看一下, 为什么总是wrong ,密码也是byte[]类型,密码输入的是对的,比对有错误码?
#5
写在构造函数里:
public DataGridView() : base()
{
this.AutoSizeRowsMode = true;
}
public DataGridView() : base()
{
this.AutoSizeRowsMode = true;
}