我有一个方法,检查返回true/false取决于列是否为null或不在sql表中。我如何检查我的sql表中的列是否为空使用c#
我该如何去检查某个列是否在我的c#方法中的sql db中为空。
public bool CheckQuoteStatus(string user)
{
//checking against the sql db in table where userid=user if column
QUOTESTATUS=NULL then return false otherwise return true
}
这里是如何连接到SQL数据库
static SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString());
你在使用连接到数据库?根据您使用的框架,可以以不同的方式返回空值。 – Dispersia
编辑我的问题,谢谢 –