This explanation assumes knowledge of ASP.NET and provides a basic RedBack example.
Stateless RBOs do not create or use a RedBack Session ID and they do not store any state on the RBO Server.
This makes them fast and efficient putting less load on a system than a stateful object.
We use the
try { //Make Connection to rbexamples database and Get object definition ROName = "EmpReader"; RBModule = "EXMOD"; DatabaseName = GetDatabaseName(); RBHandle = RBModule + ":" + ROName; // stateless object open doesn't use RedBack sessionid // or previous stored object handle ro = new REDPAGESLib.RedObject(); ro.Open2(DatabaseName, RBHandle, "", "", ""); //Set Id into Object Property myprop = (REDPAGESLib.RedProperty)ro.Property ("EmpId"); myprop.Value = (txtEmpId.Text).Trim(); //Call Method ro.CallMethod("DoRead"); // we could check some status property to see if Read Okay // ... // get property values returned // for uObject we can check new_item to see item existed myprop = (REDPAGESLib.RedProperty)ro.Property ("FirstName"); txtFirstName.Text = myprop.Value; myprop = (REDPAGESLib.RedProperty)ro.Property ("LastName"); txtLastName.Text = myprop.Value; if (txtFirstName.Text == "" && txtLastName.Text == "") { Mess.Text = "No Record found with Id = " + txtEmpId.Text; Mess.Text = Mess.Text + ". Try 1001 to 1024."; } if (ro != null) { //Close Object ro.Close(); } } catch(Exception ex) { //Set Message label with error message Mess.Text = "Exception occurred: " + ex.Message; } See the rbexamplesnetcsharp directory to review the page's entire source code. |