tags:

views:

71

answers:

1

Hi,

I have 14 text boxes on application, in that user will enter single digit numbers. My task is to retrieve and save the values of all 14 text boxes into DB... I am facing a problem in passing a string for all text boxes. Could anybody help me out in writing some code in .aspx file? I did some work on it: actually I need help in writing a method in which we can pass all 14 values as a single string.

BLL: public static SubmitParentReport GetItem(string needHours) { 
  return SubmitParentReportDB.GetItem(needHours); 
}

BO: private string needHours = ""; public string NeedHours { 
  get { return needHours; } 
  set { needHours = value; } 
}

DAL: This parameter I am using to store in database:

OracleParameter prm3 = new OracleParameter("i_need_hours", OracleType.VarChar, 2);    
prm3.Direction = ParameterDirection.Input; prm3.Value = needHours;    
myCommand.Parameters.Add(prm3);
+1  A: 

You can pass the delimited string to a stored procedure, which will parse out the string.

However, I'd opt for creating a separate OracleParameter for each one of the 14 values you want to save. This way you have better control over data type integrity and every layer of the application knows exactly what arguments to expect and what to do with them.

Kon