A question...I have a code in the example below...I have to insert some values into the database..but directly from data row..I don't want to use variables.So my question is, is there a way to check if value in data row exists or if it is null, if the value does not exist I have to insert null or if it's null just insert null...
The example:
myQuery = " INSERT INTO AGR3PL_CS (IDOC_NUM, PSEG_NUM, SEG_NUM, COMP01, GLNO01, NAME01) " +
" VALUES (" + Lidoc_num + ", '" +
PSEG_NUM + "','" +
SEG_NUM + "','" +
dr_art_custsuply["Id"] + "','" +
dr_art_custsuply["GLN"] + "','" +
dr_art_custsuply["Name"] + "')";
This is the way that I don't want to use...
if (!dr_art_custsuply.Table.Columns.Contains("GLN") || dr_art_custsuply["GLN"].ToString().Length <= 0)
{
gln = "";
}
else
{
gln = dr_art_custsuply["GLN"].ToString();
}