小编Ben*_*Ben的帖子

在localresource文件中的代码后面的字符串的转换

我为每个页面使用VisualStudio(.resx和.fr.resx)创建了本地资源文件.现在可以翻译.aspx页面中的所有控件文本.

但是我可以在这个loacal资源文件中翻译我的代码中的字符串吗?如果是,我如何从App_LocalResources映射中的本地.resx文件中读取代码中的值?

.net c# asp.net localization

7
推荐指数
1
解决办法
2961
查看次数

c#关闭sqlconnection和sqldatareader与否?

我有这段代码:


SqlConnection conn;
string strconString = System.Configuration.ConfigurationManager.ConnectionStrings["SQLCONN"].ToString();
conn = new SqlConnection(strconString);
string cmdstr = "select status from racpw where vtgid = " + vtgid;
SqlCommand cmdselect = new SqlCommand(cmdstr, conn);
conn.Open();
SqlDataReader dtr = cmdselect.ExecuteReader();
if (dtr.Read())
{
return;
}
else
{
...
}
dtr.Close();
conn.Close();
Run Code Online (Sandbox Code Playgroud)

现在我的问题是.如果返回,我的连接和dtr是自动关闭还是我应该使用bool变量并在我的连接关闭后执行返回?

c# sqlconnection sqldatareader

4
推荐指数
1
解决办法
9854
查看次数

标签 统计

c# ×2

.net ×1

asp.net ×1

localization ×1

sqlconnection ×1

sqldatareader ×1