Jump to content
Xtreme .Net Talk

Mothra

Avatar/Signature
  • Posts

    173
  • Joined

  • Last visited

2 Followers

About Mothra

  • Birthday 01/04/1973

Personal Information

  • Visual Studio .NET Version
    Visual Studio .NET 2003 Professional
  • .NET Preferred Language
    VB .NET

Mothra's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Mothra

    arrays

    Have you tried using ReDim Preserve instead of a.SetValue("...", 0), etc? When you declare the array as Dim a(500) As String, you're going to always have an array with a length of that ammount. You could also try casting the item in the ArrayList as a string before you do the split: CType(a(i), String).Split("-")
  2. You will have to either find or write your own column style to do this. This article may give you a good place to start.
  3. Is there a way to make the WriteXml method write the namespace correctly? In the Xml files I'm getting, it looks like this: ... xmlns="http://te... but it SHOULD look more like this: ... xmlns:ns="http://te... Is there a way to edit the xml file (from code) to correct this?
  4. Hey all, I have form that is running a long process on a separate thread. The process runs just fine but, if a certain condition is met, I want to set an error (with the .NET ErrorProvider control) to a text box. The problem I have is that the ErrorProvider sets, the icon shows for a second and then disappears! It works just fine if run the process on the SAME thread as the UI but, since it is a long process and there's plenty other things for the user to do, I'd rather keep it separated. Any ideas as to what may be causing my ErrorProvider to "un-set"?
  5. All you have to do is convert the text in the textbox to a number and then compare it like you did.
  6. That is what the DirectCast statement handles in VB. I'm not sure if there is a C# equivilent or not. You might try putting the name of the combobox you're trying to update in as the "target type"... ... (cboYourComboBox)cCtrl; I don't know if it will work or not but, it may be worth a try
  7. I'm not EXACTLY sure of the C# syntax but, you have to cast the item to a combobox type before you can access combobox members and methods. In VB it's like this... For Each cCtrl As Control In cTargetPanel.Controls If cCtrl = theControlYouAreLookingFor Then Dim myComboBox As ComboBox = DirectCast(cCtrl, ComboBox) 'Now you can use the combobox as you normally would myComboBox.Items.Add("bla bla") End If Next I believe the C# syntax for casting an object to a different type is: (targetType) object In your case something like this: foreach (System.Windows.Forms.Control cCtrl in cTargetPanel.Controls) { if (cCtrl.StartsWith("cbx_") == true) { ComboBox myComboBox = (ComboBox)cCtrl; myComboBox.Items.Add("bla bla"); } } Again, I'm not exactly sure about that syntax but, you defiantly have to cast the cCtrl to a ComboBox type.
  8. Is there a way to add custom items to the Add New Item dialog? To be more specific, I want to add a custom WebForm item (one that is set up or arranged in a particular manner and the class is not Inherited from System.Web.UI.Page but rather a custom class that I have created). I'll be using this "custom" item every time instead of the standard WebForm so, instead of having to manually set up the class, I'd like to just select it from the dialog. Is this possible??
  9. Is there anything that would cause a stored procedure NOT to return a column that is in it's select statement? I have this happening every so often with several different stored procedures. They all work most of the time though. Is there some kind of SQL error that would cause a column not to be returned but not cause the whole action to fail? I am just stumped on this.
  10. In a Try-Catch block, is there a way to "ReTry" the procedure if there is an error? For example, say you have a procedure in a Try-Catch that is populating a combobox from a database and something happens that returns no rows of data (something like heavy database server traffic, etc...) but, no error is thrown. Is there a way to attempt the data retrieval from insinde the Try block?
  11. No, I was taking care of the nulls in the stored procedure (ISNULL()). As it turns out, it's not my code after all. The SQL Server was having troubles so...thanks though. I do appreciate the help.
  12. I'm getting an intermittent error and I have no idea what is causing it. Basically, I am getting info from a database (via Stored Procedure) and putting it into a DataSet. Most of the time it works just fine. Occasionally though, one of the Columns from the database does not seem to be making it into the DataSet. The columns that I'm asking for are the same every time (there is no code selecting columns based on user choices or application conditions). Can anyone think of a reason why I would occasionally not get a certain column? Here is the code I'm using to fill the dataset... Try 'Connect to the database cn = New SqlConnection(cnStr) cn.Open() 'Set the sql command's attributes cmd = New SqlCommand("spGetCallList", cn) cmd.CommandType = CommandType.StoredProcedure 'Retrieve the data from the database da = New SqlDataAdapter(cmd) da.Fill(ds) ... 'Here is where I'm requesting the data from the column that is 'that is occasionally not showing up Dim liText As String = r.Item("CallListDesc").ToString ... Catch ex As Exception 'Inform the user of the error DisplayAlert(ex.Message) End Try To make matters worse, it is also happening in a completely unrelated method as well (exact same behavior but the errors do not happen at the exact same time...). Does anyone have any ideas?
  13. I'm not sure about how to get the Icons but, to get to the folders (in VB at least, I think it's pretty much the same in C#...) you can use this: Environment.SpecialFolder.[the special folder] The Windows folders (My Documents, Desktop, My Pictures, etc...) are in an enumeration so the intellisense should kick in at that point and you can just pick the folder you're looking for. Hope that helps...
  14. I can't think of anything that would cause that to happen out of the blue. Could you post some code so we might be able to see what may be causing it?
  15. Mothra

    Get Fields

    So, your just getting a list of fields that are associated with the selected "catalog"? I would think a simple "Select fields From tblTheFields Where Catalog = [your selected catalog]" would pretty much get the job done.
×
×
  • Create New...