Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 要在oracle中插入记录_C#_Oracle - Fatal编程技术网

C# 要在oracle中插入记录

C# 要在oracle中插入记录,c#,oracle,C#,Oracle,亲爱的各位, 我是这个小组的新成员,也是c#/asp.net的新成员。 我想在oracle中插入记录,我想生成一个主键ID,但查询没有给我新ID。 如果我在oracle中运行此查询,它工作正常。 有什么建议吗 我想这是为了你 这是样品 记住-使用参数而不是纯查询(SQL注入) 我认为最好使用顺序。检查这个 if (tbsitename.Text != null) { tbsitecode.Text = dm.GetData("select nvl(max

亲爱的各位, 我是这个小组的新成员,也是c#/asp.net的新成员。 我想在oracle中插入记录,我想生成一个主键ID,但查询没有给我新ID。 如果我在oracle中运行此查询,它工作正常。 有什么建议吗

  • 我想这是为了你
  • 这是样品
  • 记住-使用参数而不是纯查询(SQL注入)

  • 我认为最好使用顺序。检查这个
    if (tbsitename.Text != null)
            { 
                tbsitecode.Text = dm.GetData("select nvl(max(to_number(id)),0)+1 from setups_setup").ToString();
                //string code = dm.GetData("select lpad(nvl(max(to_number(code)),0)+1,2,0) from setups_setup where type = 'ISITE'").ToString();
    
                MessageBox.Show(dm.GetData("select max(id) from setups_setup").ToString());
    
                //int suc = dm.SetData("Insert into setups_setup(id) values (id)");
    
                //if (suc > 0)
                //{
                //    tbsitecode.Text = dm.GetData("select max(code) from setups_setup where type = 'ISITE'").ToString();
    
                //    MessageBox.Show("Record Saved.....");
                //}
            }