我有一個方法,檢查返回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
編輯我的問題,謝謝 –