|
I am working in migrating my cr application to 10th ver from the existing 8.5 where we have to explicitly make a query in query builder and then attach it. I was using dsn in ms odbc for oracle driver to connect the DB. Now in 10.0 i have removed the query file created using 8.5 query builder and trying to write directly to command editor. the report as stand alone is working fine. but when i try to generate the pdf using my vb application then on .export option it is giving error as "Logon failed.
Details: 01S00:[Microsoft][ODBC driver for Oracle]Invalid connection string attribute". i think the problem might be with cddb_oracle.dll or crdb_oracle.dll file as i am using a evaluation version of crystal report 10. as input to dsn i am providing
1.dsn
2.usid
3.database
4.password
what else is missing . plz help.....
prashant
|
|
|
|
|
I wonder if it is possible to have a string variable that has many "child values". I mean, is it possible to declare
Dim saved(i) as String
and then save different string values to saved(1), saved(2),..., saved(n)?
I have tried this, but without success.
I have declared string and an integer
Dim i as Integer
Dim saved(i) as String
Then I have a wrote a loop that adds 1 to i and then saves a value to the string variable:
Do
i = i + 1
save(i) = StringVariableX.SubString (0,i)
Loop
The error I keep getting is: "Exception System.NullReferenceException was thrown in debuggee:
Object reference not set to an instance of an object."
|
|
|
|
|
Yes, you can create an array of strings, but no, you can not hook up the number of items in the array to a variable.
When you create the array, the number of items is decided from the value that the variable has at that moment. Changing the variable afterwards doesn't change the size of the array.
If you don't know when you create the array how many items you need, use a list instead of an array.
---
b { font-weight: normal; }
|
|
|
|
|
I don't know how many items I need to save. Do you mean I insert a listbox or is there a variable class "list"? How to use it? How to retrieve a particular value from it? How to clear the list?
Thanks in advance!
|
|
|
|
|
In framework 1.x you can use the ArrayList class, which is a list of Object. In framework 2.x you can use the generic class List<T> to create a list of any type, for instance List<String>.
Use the Add method to add items to the list, the Item property to access the items in the list, and the Clear method to empty the list.
---
b { font-weight: normal; }
|
|
|
|
|
Thank you! I'll try that.
|
|
|
|
|
hi
i have developed an application.i want to deploy it in a client machine,bt the problem is that i dont know how to make the crystal report database login information dynamic.can anybody help me in this regard to make the crystal report dynamic so that it can take the login information from the registry at the time of installation of the setup wizard?
how can i incorporate the microsoft.net framework in the setup along with the project so that it will automatically install the framework at the time of installation of projects?
any queries in this regard will be warmly solicited
i m pradip kumar from india,working in vb.net & asp.net
|
|
|
|
|
I wrote a somewhat simple User Control in VB.Net 2 which consists of only a TextBox and a Button. When using this control, how do I gain access to the textbox's TextChanged event? I'm not sure how to add the event handler to the user control so that is simply relays the textbox's event.
|
|
|
|
|
The event won't fire outside the control, nor is there built in support to bubble the event automatically. Your control has to handle the TextChangedEvent of its consituent TextBox control and in that handler fire its own event, passing the arguments it got from the TextBox. You'll, or course, have to declare your own TextChangedEvent in your UserControl.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
In the user controls class add
Public event TextChanged(sender as object, e as event args)
Under the textboxs normal event handler
eg
<br />
private sub TextBox1_TextChanged(sender as object, e as event args) handles textbox1.TextChanged<br />
raiseevnt textchanged(sender,e) 'Add this line<br />
end sub<br />
Now when the text boxs text is changed the event TextChanged will be raised.
It would also be possible to change this to:
Public event TextChanged(TheTextBox as textbox, TheText as string)
and
<br />
private sub TextBox1_TextChanged(sender as object, e as event args) handles textbox1.TextChanged<br />
raiseevnt textchanged(TextBox1,Textbox1.text) 'Add this line<br />
end sub<br />
So now you can also see what the text is and access the text box.
This may be a little over complicated but I dont call myself an expert but I hope this helps.;)
I'm not dumb I just have a huge command of thouroughly usless infromation.
|
|
|
|
|
Thank you for the insight, you've got me looking down the right path now, but I am still haveing difficulty getting it to work. Here are some more details on my situation...I actually have a user control derived from a user control.
The most primitive contro is called "FileFolderTextBox" and it's just a class that Inherits from System.Windows.Forms.TextBox. The contents of the text box is just a string that should be the path to a file or a folder, and if the text does not match an existing file or folder, the background color gets changed. Pretty simple, and that worked and is based on the TextChanged event.
The next control is a FolderBoxAndButton and a FileBoxAndButton class. Both of these classes Imports the FileFolderTextBox and simply adds a button that allows a user to select the file or folder.
Finally, I have a project that uses the FolderBoxAndButton class, and now I want to do something on the event that the text changes in the FolderBoxAndButton object.
So, in the FileFolderBoxAndButton class, I already have Private Sub FileFolderTextBox_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.TextChanged which changes the background color of the textbox. When I add Public Shadows Event TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) to the class and raise the event in my FileFolderTextBox_TextChanged sub, the event no longer fires (the background color never changes).
Am I just confused onwhat goes where or what am I missing?
And thank you for the help.
|
|
|
|
|
Hello, I have a CheckedListBox control on my form.The user can add items to the list and check or uncheck any item they wish. They can edit and remove items. This far, I am ok with the coding, however, when the form closes, I want all those items that are checked to be removed, but I am not sure how to go about this at all. I have tried a Loop unsuccessfully and attempted a for/next, however, i have made no progress. I also need to save all the non-checked items to a setting.
I am using visual studio 2005 (language vb.net). Any help would be greatly appreciated.
Posted by The ANZAC
|
|
|
|
|
As far as too remove the checked items this should do it
<br />
Dim CIs As Windows.Forms.CheckedListBox.CheckedIndexCollection = CheckedListBox1.CheckedIndices<br />
Dim UnCheckedItems As New List(Of Object)<br />
<br />
For CI As Integer = CIs.Count - 1 To 0 Step -1<br />
CheckedListBox1.Items.RemoveAt(CI)<br />
Next<br />
<br />
'As for saving the rest<br />
For x As Integer = 0 To CheckedListBox1.Items.Count - 1<br />
UnCheckedItems.Add(CheckedListBox1.Items.Item(x))<br />
Next<br />
You have to remove them in reverse order otherwise you will get an index out of range exception before the end of the loop or remove incorrect items (I found this out my own experience)
As for saving to a setting, in the example i've used a generic list to save the remaining items, which could be set up in a module or something
I'm not dumb I just have a huge command of thouroughly usless infromation.
|
|
|
|
|
Thanks, I really appreciate it.
Posted by The ANZAC
|
|
|
|
|
Glad I could help
I'm not dumb I just have a huge command of thouroughly usless infromation.
|
|
|
|
|
I have a transparent form (border style 0) that has no maximize button. Still when I double-click the window, it maximizes. Is there a way to prevent this happen when doubleclicking? And if there is a built-in keyboard combination in Windows XP to maximize windows, I would like to prevent that too.
Thanks!
|
|
|
|
|
Use the MinimumSize and MaximumSize properties (set them to the same value).
|
|
|
|
|
Thanks, but I have tried that. Window still gets maximized.
I have used this code to make my form movable:
Protected Overrides Sub WndProc(ByRef m As _
System.Windows.Forms.Message)
Const WmNcHitTest As Integer = &H84
Const HtCaption As Integer = 2
If m.Msg = WmNcHitTest Then
m.Result = New IntPtr(HtCaption)
Else
MyBase.WndProc(m)
End If
End Sub
Maybe there is the problem?
|
|
|
|
|
Doesn't anyone know how to solve my problem?
|
|
|
|
|
We're sorry, you caught us all on a Holiday Weekend, in the States anyway. It's very rude to demand an answer in a forum environment.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I'm wondering what you put in to make it do that. I put a little test project together, turned the FormBorderStyle to None (0) and can't duplicate the behavior you're talking about.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
What's that piece of code supposed to do?
|
|
|
|
|
The border style is set to zero and the form is transparent. The code snippet I posted makes the form movable. When I double click the form it will maximized. This is strange.
|
|
|
|
|
I am working on Linux right now, so I cannot check this, but maybe you could try to set an appropriate size of your form in OnResized or OnMaximized (I guess that there are such events) event handlers.
|
|
|
|
|
Why not use plain old .NET code to make the form movable? You won't have this problem then.
|
|
|
|