
Mothra
Avatar/Signature-
Posts
173 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Mothra
-
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("-")
-
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.
-
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?
-
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"?
-
All you have to do is convert the text in the textbox to a number and then compare it like you did.
-
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
-
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.
-
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??
-
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.
-
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?
-
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.
-
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?
-
Couple of quick Questions
Mothra replied to rifter1818's topic in Interoperation / Office Integration
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... -
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?
-
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.
-
You could pass them back to the opening page using javascript. If you're passing the value(s) to controls on the opening page, it would look something like this: window.opener.document.getElementById('controlName').value = 'yourValue'; Without using cookies, session or application variables, there's not many other ways to do it.
-
Instead of useing the confirm dialog, you could use a simple small web page with your message and 2 buttons on it and open it as a Modal Dialog using javascript. The modal dialog would return a value and you can determine that value and take appropriate action.
-
I'm too disappointed with VS.NET and its Windows Forms
Mothra replied to m_oliveira's topic in Windows Forms
There are other .NET development tools available. Check out this link http://www.icsharpcode.net/OpenSource/SD/ It's a pretty decent alternative to Visual Studio (and it's free). I haven't used it very much since I'm using VS at work so I can't say anything about it's preformance though. I also agree with techmanbd, MS has a habit of dropping support and "encouraging" people to move to the newer technology so, I wouldn't be so quick to forget about .NET. But, all politics aside, I think that the .NET platform (VB .NET in particular) is far superior to 6.0. Not to bag on VB 6 but, Visual Basic is a "real" language now and offers so much more in terms of capabilities. I have to do work with 6.0 on occasion and I can't stand the limitations compared to .NET. Embrace the change brother. -
A "Select Top 1" query is only going to give you one record. I wouldn't think that you would need a list box for only 1 record.
-
That is very easily done using javascript. I do it all the time.
-
Is it possible to configure an application to point to required dlls outside of the application's directory (in a different directory than the .exe)? If so, how would this be done?
-
The checkedlist box has a CheckedItems collection and that has a .Contains function that accecpts an Object as a parameter. It looks through the items in the listbox that are "Checked" and if it finds the specified item, return true. Obviously, if it does not find the item it returns false. Your code should look like this... For Each o As Object In frmExam.clbSystemsHead.CheckedItems 'Do your stuff... Next
-
Is this for a Web Form and Windows forms app?
-
The keyword 'null' is not supported in Visual Basic (if this is a VB app). You have to use 'nothing' instead.
-
In that case, you could put it in the click event... Private Sub cmdWizard_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdWizard.Click frmWizard = New frmWizard() frmWizard.Show() End Sub In any case you're going to have to assign the varaiable (frmWizard) a value. Otherwise, it's just an empty box.