CrossofIron
Programmer
Hello.
i have a problem with datareader
when i run it i get
'Specified cast is not valid ' error
string str = "select max(substr(type,instr(TYPE,'/')+1,length(type)))+1 result from DOCUMENTTYPES where type like 'DCO%'";
dOCTINCTYPETextBox.Text = DataBase.GetDataReader(str).GetString(0);
but afther changing it to this:
string str = "select max(TYPE) result from DOCUMENTTYPES where type like 'DCO%'";
dOCTINCTYPETextBox.Text = DataBase.GetDataReader(str).GetString(0);
it works without problem ,i don't know why?
but if run this query in toad it works without problem
select max(substr(type,instr(TYPE,'/')+1,length(type)))+1 result from DOCUMENTTYPES where type like 'DCO%'
help me please
thanks in advance
i have a problem with datareader
when i run it i get
'Specified cast is not valid ' error
string str = "select max(substr(type,instr(TYPE,'/')+1,length(type)))+1 result from DOCUMENTTYPES where type like 'DCO%'";
dOCTINCTYPETextBox.Text = DataBase.GetDataReader(str).GetString(0);
but afther changing it to this:
string str = "select max(TYPE) result from DOCUMENTTYPES where type like 'DCO%'";
dOCTINCTYPETextBox.Text = DataBase.GetDataReader(str).GetString(0);
it works without problem ,i don't know why?
but if run this query in toad it works without problem
select max(substr(type,instr(TYPE,'/')+1,length(type)))+1 result from DOCUMENTTYPES where type like 'DCO%'
help me please
thanks in advance