|
|
If VB.NET has friend classes and C# doesn't, then I need to kill someone.
Christian Graus - C++ MVP
|
|
|
|
|
|
Could someone please help me with what must be simple issues:
1. How do I disallow null values in a datatable (change them automatically to "" for instance). Do I have to write my own routine to loop through the table and check when it is updated?
2. How do I get rid of a deleted row in a datatable? (The row seems to stay in the table even though its status becomes "deleted") Do I need to write my own routine to copy the data to a temporary table and then back into the working table?
3. How do I NOT display a given row in a datagrid (even though the row is still in the datatable). Again, do I have to write my own copy routine?
tia! and happy thanksgiving to all.
|
|
|
|
|
Hi,
1. (assuming that you fill your datatable from an sql query) Adapt the SELECT clause in your query like so: SELECT ISNULL(MyTable.MyField1, ""), ISNULL(MyTable.MyField2, ""), etc . This will return "" instead of NULL. Instead of "" you can use pretty much any string or number.
2. At the point in your code where the datatable has been edited (rows deleted, field values changes, etc), but before you do anything else with the dataset, you have to tell the dataset to accept changes made, like so: YourDataSet.AcceptChanges()
3. I don't think there is any ready property to do this (but I am far from expert). I have solved a similar problem, where I needed for the user to be able to "filter" out rows with 0 values in a certain column, without actually deleting them, like so:
<br />
Dim TempDataSet as New DataSet<br />
Private Sub CmdFilter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdFilter.Click<br />
TempDataSet.Clear()<br />
TempDataSet = MyMainDataSet.Copy 'Copy your original dataest into a temporary one<br />
'Do whatever you must here<br />
MyMainDataSet = TempDataSet.Copy 'and when you are done, copy it back<br />
MyDataGrid.DataSource = MyMainDataSet<br />
MyDataGrid.DataMember = "TableName"<br />
End Sub<br />
Otherwise, you will have to come up with your own code, yes.
Hope this helps you,
Johan
|
|
|
|
|
Dear All,
Is it able to rotate the string in a text box as a mirror .How can I?
|
|
|
|
|
use the StrReverse function of vb.net
example :
Dim lbl As String = "asp_net"
Label1.Text = StrReverse(lbl)
asp_net will be shown as ten_psa in Label1
i hope this is what you are looking for.
Take care
|
|
|
|
|
Not as a mirror, no. You'd need to create your own control for that.
Christian Graus - C++ MVP
|
|
|
|
|
Hi everybody,
My question could seem to be easy, but I'm a newbie in VB.NET development.
Is it possible to declare a multi-dimensionnal array, but containing different data-type. I mean :
I've got a array containing my own data (actually, it contains objects of type FrameInterpretor which contains some bytes arrays), and I would like to associate to this data an integer.
Thanks a lot for your replies,
Regards,
Ch'Portos.
Yop Yop !!
|
|
|
|
|
Seems like you need to use a Hashtable or Dictionary in which the key is your integer and the value is your FrameInterpreter. If you're using .NET 2 then Dictionary is the one to use. You should find examples in the MSDN documentation.
Kevin
|
|
|
|
|
Hi,
Thanks for your help, but I found another way to do what I want.
I simply created a private class in which I have 2 attributes, one of the FrameInterpreter type, one of Integer type.
After I use an array of objects of this new class
Ch'Portos.
Yop Yop !!
|
|
|
|
|
if i use this line -> myRestrictItems.Item(i).ReceivedTime
in the method i'm getting MissingMethodException ! i just cant understand why it is so?
this page shows that its a bug or something http://support.microsoft.com/kb/834063 but still i'm not able to get away with it !!
|
|
|
|
|
I think I had something similar to this a few weeks ago when using Analysis Services. The fix was to apply the latest Analysis Services service pack.
Kevin
|
|
|
|
|
hiho,
I've got 3rd parity dll and want to bind them in my code with "CreateObject". with "dim t as new dll.klasse" it runs but not with "CreateObject". The Code of the dll is not managed c++ code and i don't have the source code
|
|
|
|
|
CreateObject will NOT let you do something like Dim t As New MyClass . CreateObject is used for late-bound creation of objects.
In order to create objects using Dim , you have to add a reference to the .DLL and this will only work if the .DLL is COM-based.
So, how you can use this .DLL depends entirely on the .DLL and the version of VB you're using. You can't just use it "the way you want to".
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
sry, i mean wat u say.. i declare a variable with dim t as object and then i want to set the variable with Set t = CreateObject("mydll.myclass"). but it diddn't run
|
|
|
|
|
Is the .DLL a COM-based DLL and is it registered, using REGSVR32? If not, you can't use CreateObject. CreateObject can only be used to create COM-based objects.
You can't just specify a .DLL filename and some name. You MUST use the COM-exposed name (ProgID) of the object in the library you want.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
yes the dll is registered. i've searched in the registry and found the clsid with progid.. but when i use them.. it dosen't run. The Name of the ProgID is "BARCODE.BarcodeCtrl.1" and the class name is "Barcode". When i call "Set myVar = CreateObject("BARCODE.BarcodeCtrl.1.Barcode")" then i get the error..
.. i've even tested without the class.. and it runs!! but i'm not sure with object i've get.. i hope it was the barcode-class object
|
|
|
|
|
You can only use the ProdID, without appending the class name:
Set myvar = CreateObject("BARCODE.BarcodeCtrl.1")
That should represent the COM object (class) that you're looking for.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i was EXport some data form my vb6 to EXCEL.
But when i close my program i found out that the EXCEL.exe is still running...
wat is the command to terminate the EXCEL.exe when i close my program????
|
|
|
|
|
Dim e As New excel.Application
e.Quit
|
|
|
|
|
Hi,
I need to write a very little vb.net console application that can mute or unmute the sound device and change the level of each entry to 0 or max.
I've looked around without succes.
I'm sure that someone here can help me !
Thx
|
|
|
|
|
Hi ,
I want to populate a treeview with 1 million nodes.
How can i do that while maintaining the efficiency of the web page.
i want to achieve this in asp.net 1.1
though i have the option of working in asp.net 2.0 but i m not familiar with that.
suggestions for asp.net 2.0 are also welcome.
thanks & regards
Kapil Thakur
|
|
|
|
|
Kapil Thakur wrote: How can i do that while maintaining the efficiency of the web page.
You can't. Your page will still load exceptionally slowly even on a DSL line. That is if the treeview control will even support that many nodes (I seriously doubt that it supports more than +/- 32 thousand).
You should rather think of another solution.
|
|
|
|
|
hi,
thanks for the reply.
i knew that loading such a tree is impossible.
however is there any way by which i can implement the previous & next methods like paging in datagrid.
that is, on demand i can load a certain number of nodes and then get options like previous and next links. on clicking them, i will load next number of nodes.
can that be achieved?
thanks & regards,
Kapil Thakur
|
|
|
|