320 questions
0
votes
0
answers
57
views
Object cannot be cast from DBNull to other types when writing query string and opening connection
using (MySqlConnection Conn = new MySqlConnection(TheConn))
{
MySqlDataReader MySqlReader;
MySqlCommand cmd;
string queryString = "SELECT * FROM user_table WHERE ...
1
vote
1
answer
114
views
Error while converting Datatype due to DBNulls
I am trying to load data using my c# application by calling a stored procedure from one database and would then need to insert that data into another database. I am planning to using SQL bulk insert ...
0
votes
0
answers
128
views
DataSet table is not null even there isn't any values at row [0]
I have following code where I get dataset through method readAvgReview.
If dataset [0] table includes any avg values (between 1-10) I want to display values to the page.
If it doesn't include these ...
0
votes
1
answer
163
views
NULL value in SQL Server database
I have a SQL Server database where sometimes a date column contains NULL. Now I read that data into an ASP.NET Core page and it stops reading when it encounters the first NULL column.
That NULL should ...
0
votes
3
answers
357
views
Trying to create a xunit test for DBNull
I am trying to create a xunit test for a method that checks for DBNull.Value. I am currently using InlineData to create the test but it is giving an error when attempting to use 'DBNull.Value' as my ...
-2
votes
2
answers
525
views
How to convert a value if it's null
I am using C#
Convert.ToDateTime(rdr["Termination_Date"])
rdr is defined as
OracleDataReader rdr = cmd.ExecuteReader();
The Termination_Date field in the table maybe null. How do I check ...
0
votes
2
answers
1k
views
How to Consider NOTHING in VB.Net to NULL in SQL Server via NULLABLE Variable
Parameters in Stored Procedure are @classid INT = NULL, @streamid INT = NULL. Now in VB.NET I have declared two variable Dim classid As Int32?, streamid As Int32? as NULLABLE. If no value is passed to ...
0
votes
0
answers
240
views
How to deal with Object can not be cast from DBNull to other types?
I have checked couple of post here suggesting how to deal with DBNull vale so I followed the same. Here are my code. But still I am getting the error message
Object can not be cast from DBNull to ...
0
votes
2
answers
519
views
Conversion from type DBNull to type String is not valid in vb.net
Please the solution I have an error "Conversion from type 'DBNull' to type 'String' because the pathhelper column has a null value
Private Sub gridView1_CustomUnboundColumnData(ByVal sender As ...
0
votes
1
answer
715
views
Powershell datatable created a null row issue
I'm writing a Powershell script to create an unique contacts in datatable. The steps are as following:
I first extracted the data from a CSV and put the data in $dt_uniqueContacts datatable (with just ...
1
vote
1
answer
4k
views
how to replace empty string with null in pandas? [duplicate]
empty string like this isnull() not find empty string
conn = connect(host='localhost',port=3306,user='root',password='root',database='spiderdata',charset='utf8')
df = pd.read_sql('select * from ...
0
votes
2
answers
256
views
Using ODBCDataReader, why can't I detect DBNull in a field using DBNull.Value.Equals or IsDBNull in vb.net? Deffinitely DBNull
The way I know it's deffintely DBNull is when I use String.IsNullOrEmpty it errors out with 'Cant convert type DBNull to type String'
I'm using an ODBCDataReader with the following ODBCCommand to ...
0
votes
3
answers
1k
views
Datatable handle DB NULL
I made connection to a SQL Server database with Azure functions and I am trying to make a datatable
string GetAllItems = String.Format("SELECT * FROM dbo.vw_SO_Leg WHERE Customer=" + ...
1
vote
0
answers
898
views
Using DataTable.Compute filter on null entries
Suppose that there is a DataTable dt of type double with the columns "x","y","z" in C#.
While values are filled into dt, it certainly occurs that only two dimensions are ...
-1
votes
1
answer
218
views
Clear to int value (DbNull.Value) [closed]
I want to change column value to DbNull.Value,
I tried; stokIst.IstasyonId = DBNull.Value;
stokIst not a primary key but its int column. I want to clear the value in the column as the target. When I ...