null

How do I check for null or empty string for many arguments? - C#

▼魔方 西西 提交于 2020-07-15 22:52:30
问题 I have the below method, which I need to check for whether the arguments are empty or null. public DB Where(string field, string operat, string value, string andOr, string field2, string operat2, string value2) { _Where = " WHERE " + field + " " + operat + " @" + field + "1 " + andOr + " " + field2 + " " + operat2 + " @" + field2 + "2 "; _Params.Add(field + "1", value); _Params.Add(field2 + "2", value2); return this; } I have found the string.IsNullOrWhiteSpace method however this would

Change a column to not allow nulls

北城以北 提交于 2020-07-15 04:31:39
问题 So I want to change a column in my SQL Server database to not allow nulls, but I keep getting an error. this is the sql statement I am using: alter table [dbo].[mydatabase] alter column WeekInt int not null and this is the error I am getting : Msg 515, Level 16, State 2, Line 1 Cannot insert the value NULL into column 'WeekInt', table 'CustomerRadar.dbo.tblRWCampaignMessages'; column does not allow nulls. UPDATE fails. The statement has been terminated. I'm pretty sure my sql is right, and

Change a column to not allow nulls

China☆狼群 提交于 2020-07-15 04:31:37
问题 So I want to change a column in my SQL Server database to not allow nulls, but I keep getting an error. this is the sql statement I am using: alter table [dbo].[mydatabase] alter column WeekInt int not null and this is the error I am getting : Msg 515, Level 16, State 2, Line 1 Cannot insert the value NULL into column 'WeekInt', table 'CustomerRadar.dbo.tblRWCampaignMessages'; column does not allow nulls. UPDATE fails. The statement has been terminated. I'm pretty sure my sql is right, and

Change a column to not allow nulls

僤鯓⒐⒋嵵緔 提交于 2020-07-15 04:31:24
问题 So I want to change a column in my SQL Server database to not allow nulls, but I keep getting an error. this is the sql statement I am using: alter table [dbo].[mydatabase] alter column WeekInt int not null and this is the error I am getting : Msg 515, Level 16, State 2, Line 1 Cannot insert the value NULL into column 'WeekInt', table 'CustomerRadar.dbo.tblRWCampaignMessages'; column does not allow nulls. UPDATE fails. The statement has been terminated. I'm pretty sure my sql is right, and

Change a column to not allow nulls

為{幸葍}努か 提交于 2020-07-15 04:31:01
问题 So I want to change a column in my SQL Server database to not allow nulls, but I keep getting an error. this is the sql statement I am using: alter table [dbo].[mydatabase] alter column WeekInt int not null and this is the error I am getting : Msg 515, Level 16, State 2, Line 1 Cannot insert the value NULL into column 'WeekInt', table 'CustomerRadar.dbo.tblRWCampaignMessages'; column does not allow nulls. UPDATE fails. The statement has been terminated. I'm pretty sure my sql is right, and

Not able to use button as it is on another layout

こ雲淡風輕ζ 提交于 2020-07-10 10:27:00
问题 My Main Activity. This is where all my coding is done. FrameLayout simpleFrameLayout; TabLayout tabLayout; VideoView video; Button btn_show; InterstitialAd interstitialAd; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); btn_show = (Button) findViewById(R.id.bt_show); interstitialAd = new InterstitialAd(this); interstitialAd.setAdUnitId("ca-app-pub-8708219564656739/2401085524"); interstitialAd.loadAd(new

C# & SQL Server : how to Insert DBNull.Value in command parameter if string value is empty?

流过昼夜 提交于 2020-07-09 15:47:25
问题 I've been searching for a couple of hours now and cannot find a solution. I am inserting some strings into SQL, however on on occasions, the method I use to do this may contain strings that are empty, i.e "" I therefore want to insert a null value into SQL Server instead. Firstly I test my method to make sure I am able to insert a DBNull.Value manually by using the following: cmd.Parameters.AddWithValue("@surname", DBNull.Value); // THIS WORKS OK HOWEVER when I try the following below, the

C# & SQL Server : how to Insert DBNull.Value in command parameter if string value is empty?

怎甘沉沦 提交于 2020-07-09 15:47:07
问题 I've been searching for a couple of hours now and cannot find a solution. I am inserting some strings into SQL, however on on occasions, the method I use to do this may contain strings that are empty, i.e "" I therefore want to insert a null value into SQL Server instead. Firstly I test my method to make sure I am able to insert a DBNull.Value manually by using the following: cmd.Parameters.AddWithValue("@surname", DBNull.Value); // THIS WORKS OK HOWEVER when I try the following below, the

A /dev/null equivilent for DISPLAY when the display is just noise

流过昼夜 提交于 2020-07-04 08:30:32
问题 I'm running a java app which creates a visual display of some of the things it is doing, while it is doing it. However, I'm want to run this in a script that won't have a display to attach to. In the current environment, there isn't even a DISPLAY environment variable set. I tried to simply set my DISPLAY to :0.0. But that doesn't exist. I don't really care about the display. I just want the app to process the files silently. Since I can't just turn the display off(not my app), I'm left with

A /dev/null equivilent for DISPLAY when the display is just noise

梦想的初衷 提交于 2020-07-04 08:30:19
问题 I'm running a java app which creates a visual display of some of the things it is doing, while it is doing it. However, I'm want to run this in a script that won't have a display to attach to. In the current environment, there isn't even a DISPLAY environment variable set. I tried to simply set my DISPLAY to :0.0. But that doesn't exist. I don't really care about the display. I just want the app to process the files silently. Since I can't just turn the display off(not my app), I'm left with