小编Jai*_*on 的帖子

无法将对象从DBNull强制转换为其他类型

无法将对象从DBNull强制转换为其他类型.

我有一个以下函数抛出上述错误.我正在处理存储过程和C#代码中的所有空值.

那么它在哪里得到这个错误?

我可以在catch块中看到错误.但我不明白以下create()中哪一行得到错误.

public Boolean Create(DataTO DataTO)
{
    IDbTrans transaction = null;
    IDbCmd IDbCmd;

    string EncryptedPassword = Encrypt(DataTO.txtPwd);
    Base dataAccCom = null;

    try
    {
        dataAccCom = Factory.Create();
        dataAccCom.OpenConnection();
        transaction = dataAccCom.BeginTransaction();
        IDbCmd = dataAccCom.CreateCommand("sp_Register", true);
        dataAccCom.AddParameter(IDbCmd, "op_Id", DbType.Int64, 0, ParameterDirection.Output);
        dataAccCom.AddParameter(IDbCmd, "p_dlstTitle", DbType.String, ReplaceNull(DataTO.dlstTitle));
        dataAccCom.AddParameter(IDbCmd, "p_txtFirstName", DbType.String, ReplaceNull(DataTO.txtFirstName));
        dataAccCom.AddParameter(IDbCmd, "p_txtMiddleName", DbType.String, ReplaceNull(DataTO.txtMiddleName));
        dataAccCom.AddParameter(IDbCmd, "p_txtLastName", DbType.String, ReplaceNull(DataTO.txtLastName));
        dataAccCom.AddParameter(IDbCmd, "p_txtDob", DbType.DateTime, DataTO.txtDob);
        dataAccCom.AddParameter(IDbCmd, "p_txtDesig", DbType.String, ReplaceNull(DataTO.txtDesig));
        dataAccCom.AddParameter(IDbCmd, "p_txtOFlatNo", DbType.String, ReplaceNull(DataTO.txtOFlatNo));
        dataAccCom.AddParameter(IDbCmd, "p_txtOBuild", DbType.String, ReplaceNull(DataTO.txtOBuild));
        dataAccCom.AddParameter(IDbCmd, "p_txtOPost", DbType.String, ReplaceNull(DataTO.txtOPost));
        dataAccCom.AddParameter(IDbCmd, "p_txtOArea", DbType.String, …
Run Code Online (Sandbox Code Playgroud)

.net c# asp.net parameters

39
推荐指数
4
解决办法
16万
查看次数

HTML中的卢比符号

我对我的asp.net网页中的卢比符号有点疑虑,我对CSS有所怀疑:

以下是我的代码:

HTML:

<div id="container"><span>Rs.</span> 5000</div>
Run Code Online (Sandbox Code Playgroud)

CSS:

@font-face{
    font-family:‘WebRupee’;
    src:url(‘WebRupee.V2.0.eot’);
    src:local(‘WebRupee’), url(‘WebRupee.V2.0.ttf’)format(‘truetype’), url(‘WebRupee.V2.0.woff’) format(‘woff’), url(‘WebRupee.V2.0.svg’) format(‘svg’);
    font-weight:normal;
    font-style:normal;
}
.WebRupee{
    font-family:’WebRupee’;
}
html > body.WebRupee {
    margin-right:2px;
}
html > body.WebRupee {
    *margin-right:0;
}
#container {
    width:500px;
    margin:50pxauto;
}
Run Code Online (Sandbox Code Playgroud)

我想在asp.net网页上获得卢比符号.这里有什么遗漏?

这是我引用的网址:

点击这里

我是否需要在我的系统中安装任何东西..?

它是否适用于我的网站在世界上使用而没有在用户(他们的)系统中安装任何内容的所有用户?

我可以使用上面的代码附加已经存在的CSS文件(用于我使用卢比符号的同一html文件中的其他div标签)吗?在那种情况下,我需要将hss #container中的css和id中的名称更改为其他内容,因为我已经拥有#container吗?

我没有在CSS中看到#container上面的部分

:即

@font-face{font-family:‘WebRupee’;src:url(‘WebRupee.V2.0.eot’);src:local(‘WebRupee’), url(‘WebRupee.V2.0.ttf’)format(‘truetype’),url(‘WebRupee.V2.0.woff’)format(‘woff’),
url(‘WebRupee.V2.0.svg’)format(‘svg’);font-weight:normal;font-style:normal;}
.WebRupee{font-family:’WebRupee’;}
html>body.WebRupee{margin-right:2px;}
html>body.WebRupee{*margin-right:0;}
Run Code Online (Sandbox Code Playgroud)

在html中没有为DIV辩护..它是那样的,还是我需要在课堂上制作它

应该是这样的..

.rupee
{

@font-face{font-family:‘WebRupee’;src:url(‘WebRupee.V2.0.eot’);src:local(‘WebRupee’), url(‘WebRupee.V2.0.ttf’)format(‘truetype’),url(‘WebRupee.V2.0.woff’)format(‘woff’),
url(‘WebRupee.V2.0.svg’)format(‘svg’);font-weight:normal;font-style:normal;}
.WebRupee{font-family:’WebRupee’;}
html>body.WebRupee{margin-right:2px;}
html>body.WebRupee{*margin-right:0;}
}
Run Code Online (Sandbox Code Playgroud)

我可以称之为..

<div id="container" class = "rupee"><span>Rs.</span> 5000</div>
Run Code Online (Sandbox Code Playgroud)

.rupee和#rupee之间究竟有什么区别?

在此先感谢您的帮助!!

html css font-face

1
推荐指数
1
解决办法
2万
查看次数

标签 统计

.net ×1

asp.net ×1

c# ×1

css ×1

font-face ×1

html ×1

parameters ×1