• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 460
  • Last Modified:

working with sql inserting type double, string, int - How to detect unasigned value.

Hi there

i am try to work with data type
double, int, enum, string in vb.net and create a function to insert/select from mysql

i have issue when to create this function i have no way to know if the value should be insert to sql or not because i dont know if it unassigned or or assigned.

the idea is that if i know the value is unassigned then i will not generate TSQL to insert into SQL and so database will not insert incorrect value such as 0 or "".

On the other hand, when pull the data from SQL i need to know that these value is not assigned so i can display on application as not available... instead of showing 0 or something that has incorrect meaning...
Thanks,

 
0
JSW21
Asked:
JSW21
  • 3
  • 2
1 Solution
 
JSW21Author Commented:
To explain a bit more:
When I assigned no data as 0 for an enum type i can filter the zero out during TSQL insertion but it will be wrong b/c data can be 0....

My older application i assigned value like -987654321 to id the non assigned value but it get bulky.
and it would slow thing down.
0
 
CodeCruiserCommented:
Some more explanation please(outside of assigned/unassigned).
0
 
JSW21Author Commented:
oh,

Say I want to update field columns in SQL with .. x y z .... My function does not know which  x y z is a new data... x y z are members in a class obj.

because If know which is not updated then I would exclude it from TSQL
The question is how do I identify if any member in this class has some value assigned to it.

for instance if class is a stock data ... some stock has volume field , and another doest have volume field ... sort of speak. but Volume can be 0.

0
 
CodeCruiserCommented:
Show us the code in the function. May be you want to use NullAble(of T) as types of members in the class and then use .HasValue to find out if the member has been assigned a value.
0
 
JSW21Author Commented:
thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now