i have a problem for update table in winfom to oracle database 10g. insert using procedure in oracle. it do not update succesful. help me, please:((
when aplication was execute, do not insert. thanks you very much.
this is my code for insert funtion:
public void update(string studentCode, string Name,string sex, DateTime birthday, string address, string ClassID,string email)
{
try
{
String birthday1=birthday.ToShortDateString();
provider.command.Connection =provider.connection ;
provider.command.CommandType=System.Data.CommandType.StoredProcedure;
provider.command.CommandText="UPDATE_STUDENT";
//_provider.command.CommandType=System.Data.CommandType.StoredProcedure;
//MAHS
p= new OleDbParameter();
p.Direction=System.Data.ParameterDirection.Input ;
p.OleDbType=System.Data.OleDb.OleDbType.VarChar ;
p.Value=maHS;
provider.command.Parameters.Add(p);
//HOTEN
p= new OleDbParameter();
p.Direction=System.Data.ParameterDirection.Input ;
p.OleDbType=System.Data.OleDb.OleDbType.VarChar ;
p.Value=tenHS;
provider.command.Parameters.Add(p);
//PHAI
p= new OleDbParameter();
p.Direction=System.Data.ParameterDirection.Input ;
p.OleDbType=System.Data.OleDb.OleDbType.VarChar ;
p.Value=phai;
provider.command.Parameters.Add(p);
//ngaysinh
p= new OleDbParameter();
p.Direction=System.Data.ParameterDirection.Input ;
p.OleDbType=System.Data.OleDb.OleDbType.VarChar ;
p.Value=ngay_sinh;
provider.command.Parameters.Add(p);
//DIACHI
p= new OleDbParameter();
p.Direction=System.Data.ParameterDirection.Input ;
p.OleDbType=System.Data.OleDb.OleDbType.VarChar ;
p.Value=diachi;
provider.command.Parameters.Add(p);
//EMAIL
p= new OleDbParameter();
p.Direction=System.Data.ParameterDirection.Input ;
p.OleDbType=System.Data.OleDb.OleDbType.VarChar ;
p.Value=email;
provider.command.Parameters.Add(p);
provider.command.ExecuteNonQuery();
}
catch (Exception e)
{
throw new Exception(e.ToString());
}
}
Loading

CrishRank #1,487 · 1.1K reputationPosted Dec 1, 2010, 8:36 PM EST
I have same problem .Thanks for giving solution of this issue. now it will help us in our project.
Suthish NairRank #92 · 22.8K reputationPosted Dec 1, 2010, 10:10 PM EST
Are you Spamming the forum. Same messages getting copy pasted in each thread.
Tam asked for a solution for his question.
Suthish NairRank #92 · 22.8K reputationPosted Dec 1, 2010, 10:16 PM EST
Welcome to C# Corner.
Can you provide more information, like what error you getting.
Put a breakpoint and check which line throwing error.
Or, check Our recommended articles section for oracle artilcles.
Some samples already there to help you.
Tam Nguyen15 reputationPosted Dec 1, 2010, 10:40 PM EST
at QLHSC3.HOCSINH.HocSinhData.insert(String maHS, String tenHS, String phai, DateTime ngaySinh, String diachi, String maLop, String email, Int32 siso) in E:\backup\QLHSC3\QLHSC3\HOCSINH\HocSinhData.cs:line 46
Suthish NairRank #92 · 22.8K reputationPosted Dec 1, 2010, 11:50 PM EST
Tam Nguyen15 reputationPosted Dec 2, 2010, 4:15 AM EST
image throw error when execute step by step.
help me, please!
Sam HobbsRank #107 · 20.5K reputationPosted Dec 2, 2010, 8:49 AM EST
While debugging the program, when the exception occurs, look at the parameters of QLHSC3.HOCSINH.HocSinhData.insert. At least one of the parameters is null.