如果key为null,如何避免错误?
//Getter/setter
public static Dictionary<string, string> Dictionary
{
get { return Global.dictionary; }
set { Global.dictionary = value; }
}
Run Code Online (Sandbox Code Playgroud)
更新:
Dictionary.Add("Key1", "Text1");
Dictionary["Key2"] <-error! so what can I write in the GET to avoid error?
Run Code Online (Sandbox Code Playgroud)
谢谢.
问候
我需要帮助。
我有一个与另外两个表 t1 和 t3 相关的 sql 表 t2。
t2 有字段:
idFromt3 idFromt1 Value
1 14 text1
2 14 text2
1 44 text1
2 44 text2
3 44 text3
Run Code Online (Sandbox Code Playgroud)
我正在寻找缺少 ifFromt3 的值。我想在这个例子中找到值 ifFromt3 = 3,因为它不存在。
我正在像这个例子那样做,但它不能正常工作。
SELECT t3.idFromt3, t3.idFromt1
FROM t3
INNER JOIN t2
ON t3.LanguageMessageCodeID <> t2.idFromt2
Run Code Online (Sandbox Code Playgroud)
这是3张桌子。
CREATE TABLE [dbo].[t3](
[t3ID] [int] IDENTITY(1,1) NOT NULL,
[Name] [varchar](50) NOT NULL,
)
CREATE TABLE [dbo].[t2](
[t2ID] [int] IDENTITY(1,1) NOT NULL,
[t3ID] [int] NOT NULL,
[t1ID] [int] NOT NULL,
)
CREATE …Run Code Online (Sandbox Code Playgroud)