Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Custom Controls and Properties
Message
From
31/10/2002 17:48:14
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, United States
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00717518
Message ID:
00717607
Views:
19
Cathi,

How would I define the session variable as a dataset? Would it be Dim dsResults as new dataset? Is there another way of doing this?

JIm

>Now I understand what you are saying. Yes, your dataset will not persist between web refreshes. You need retrieve with each refresh. You can save your data in a session variable if it is really small.
>>Cathi,
>>
>> The parameters are being set and the dataset is being populated, or so it seems. I had the search button display the parameter name (@name), parameter value(6.3) and number of rows in the dataset(2). so that seems to be working fine. I made one of the buttons on the webform display the number of tables in the record set property and it displays 0. It seems that the dataset is being cleared when the webform refreshes. Would you agree with this? What can I do to keep the dataset intact?
>>
>>Thanks
>>Jim
>>
>>>If your DataTable inside your DataSet is not getting populated, I would recommend tracing your code in the debugger. Have you tried executing your Store Procedure? My thinking is that the parameters are not getting set as you expected.
>>>
>>>>All,
>>>>
>>>> I have a custom search control with a property that is a dataset. The control also has a label, a textbox, a button for searching and a requirefield control. When I click the search button data is retrieved and the dataset property is filled. I want to be able to access the dataset from a webform, but for some reason the dataset is empty and I'm not understanding why. I've included the code for the search button and the property declaration. Am I doing something wrong? Is there a better way to do this? Any suggestions or feedback would be appreciated.
>>>>
>>>>
>>>>System.Data.DataSet dssearch = new DataSet();
>>>>[Bindable(true),
>>>>Category("Data"),
>>>>DefaultValue("")]
>>>>public System.Data.DataSet dsSearch
>>>>  {
>>>>    get
>>>>     {
>>>>	this.EnsureChildControls();
>>>>	return dssearch;
>>>>     }
>>>>     set
>>>>	{
>>>>	  this.EnsureChildControls();
>>>>	  dssearch = value;
>>>>	}
>>>>  }		
>>>>
>>>>
>>>>
>>>>void cmdSearchClicked(System.Object sender, System.EventArgs e)
>>>>{		
>>>>  this.oConSearch.ConnectionString = this.connectionstring;
>>>>  this.oConSearch.Open();
>>>>  SqlDataAdapter oDaCustomer = new SqlDataAdapter(this.SearchProcedure,this.oConSearch);
>>>>  oDaCustomer.SelectCommand.CommandType = CommandType.StoredProcedure;
>>>>  oDaCustomer.SelectCommand.CommandText = this.searchproc;
>>>>  if (this.paramname.Trim().Length > 0)
>>>>    {				
>>>>	this.lblMessage.Visible = true;
>>>>	oDaCustomer.SelectCommand.Parameters.Add(this.paramname,System.Data.SqlDbType.VarChar,this.paramsize);
>>>>	oDaCustomer.SelectCommand.Parameters[this.paramname].Value = this.txtSearch.Text;
>>>>	this.dssearch.Clear();
>>>>	oDaCustomer.Fill(this.dssearch);
>>>>	this.oConSearch.Close();
>>>>	this.lblMessage.Text = this.txtSearch.Text + " " + oDaCustomer.SelectCommand.CommandText + " " + this.dssearch.Tables[0].Rows.Count.ToString();
>>>>	if (this.dssearch.Tables.Count > 0)
>>>>	  {
>>>>	    this.RecordCount = this.dssearch.Tables[0].Rows.Count;
>>>>	  }				
>>>>	}
>>>>}
>>>>
Thanks

Jim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform