|
Using Oledb how to collect the tables in .Net. Any one can help
sonj
|
|
|
|
|
All you have to do is Google[^] for it. There are plenty of examples.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I asked how do I collect in VB.Net not in vb6. Could post sample code if you have
Johnson
|
|
|
|
|
You're not understanding the examples. The table information your looking for is stored in a table itself! All you have to do is run a query, just like any other SELECT query, to return the data in a DataSet, or use a DataReader instead.
SELECT * FROM MSysObjects
WHERE (Name Not Like "MSys*") AND (Type In (1,4,6))
ORDER BY Name
Type 1 - normal tables
Type 4 - ODBC linked tables
Type 6 - Other linked tables (like SQL)
Do you know how to use the OleDbCommand, OleDbConnection, DataSet, DataReader, ... objects?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I very thankfull to giving info with Patience. I will try as you said.
Thanks
Johnson
|
|
|
|
|
Hi there,
I had been for over 3 days trying to solve this problem and I have no clue of what's wrong.
I'm trying to create a Dynamic DNS service using only one DNS Server (dns.firmaware.com), but created a second NS record (dns2.firmaware.com) with the same IP address.
First of all I've created a small app in VB .net that updates (using WMI) Microsoft DNS Server whenever an IP change was reported.
It creates different zones for each sub-domain and adds NS records, updates SOA record to change the TTL and MinimumTTL and finally adds/updates the A record.
I know that zone creation/update is working fine because I tested my VB .net several times and checked that Microsoft DNS entries were created/updated.
After checking all that I created a record like “test.gimmeall.com” and resolved it from my home PC. Using “ipconfig /displaydns” I checked that “test.gimmeall.com” had the following values:
localhost
----------------------------------------
Record data . . . . . : test.gimmeall.com
Record type . . . . . : 1
TTL . . . . . . . . . . . : 60
Data length. . . : 4
Section. . . . . . . . . . : Answer
A record (host) . . : 213.13.100.111
So, TTL was fine, if I changed test.gimmeall.com’s A record, after 60 seconds it would be updated, BUT that’s not happening because, after my update, when I ping the same host again it returns the same IP address and when I type “ipconfig /displaydns” it returns the following result:
----------------------------------------
Record data . . . . . : test.gimmeall.com
Record type . . . . . : 1
TTL . . . . . . . . . . . : 85823
Data length. . . : 4
Section. . . . . . . . . . : Answer
A record (host) . . : 213.13.100.111
It looks like that ISP or something else is caching “test.gimmeall.com” with invalid values, but it’s not an ISP problem because tried from different ISP companies and always had the same result.
Can you help me please?
I would be very thankful.
Regards,
Filipe Freire
|
|
|
|
|
I think your misunderstanding with /displaydns is showing you. It's not showing the DNS cache on the server, but rather the DNS Resolver cache on YOUR workstation. Do an ipconfig /flushdns before you try to resolve the name to it's new address from your workstation.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Sorry, forgot to say that.
Even if I flush my machine DNS cache it gets the same result.
But one strange thing happened, now it works fine.
Sometimes it works, some don't. :S
Had a great lunch, think I'm going to take a nap
If you can help me with anything else please answer.
Thank you,
Filipe Freire
|
|
|
|
|
It could also be that the server-side, too, is caching the lookup. Datbase operations are kind of expensive, so if the server can do this once, cache the result for a little while.
You might want to set the TTL for the record to 1 second. This will keep everyone from caching the result for more than that time and force the client to do to the DNS server to resolve the name.
You can also do this[^] on XP/2003 machines to force the client to drop it's cached result after 1 second, no matter what the record's TTL says.
It'll also force the cache on the server side to drop the cached result after 1 second, focing it to go to the database to resolve the name.
To alter the caching of results on the DNS Server itself, you'll have to consult the docs on what server your using.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
Is there any way to check if File.Open fails? In my code i am trying to copy a newly created file in one directory to another, but I want to make sure the file creation is complete, if not i will have to wait and try File.Open again.
Also, when i am done the File.Open, i couldn't find a way to close the file. Or i don't have to close it before i start copying that file to another directory?
|
|
|
|
|
If the Open fails, it'll throw an exception. Just wrap your code in a Try/Catch block to catch it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi All,
I am using "USB to serial port converter" to program my USB port.As soon as the USB cable is plugged-in the driver installed allocates a COM port number to the USB Port. So usually the last allocated port number is for USB.In my program when the user opts for communiocation over USB port i will find all the valid ports in the pc and assume the last port number as the USB port number.If the USB cable is not connected then no COM Port number is allocated to USB port.So the method i am using to find out the COM port number allocatted USB port is not robust method. So i just want to know whether there is any method to find out the USB cable connected to the USB port through VB code.. Somebody help me with this.
Thanx in Advance,
Sushma
|
|
|
|
|
I am attempting my first ever drag and drop: basically I want to drag from a picture to a button (or any other control like a picture or panel) and note the co-ordinates of the point where the drop actually occurs.
The DragEventArgs has properties X and Y which, I understand, are meant to be the co-ordinates where the mouse is when the drop event occurs.
My problem is that, every time I run the same program; drag the same control to the same place the co-ordinates are different!!!
{341,379} {363,408} {385,436} {296,320} {275,291} and so on ......
Can anyone help? Thanks
Deemo
Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown<br />
PictureBox1.DoDragDrop(PictureBox1.Name, DragDropEffects.Copy)<br />
<br />
End Sub<br />
<br />
Private Sub button3_DragDrop(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Button3.DragDrop<br />
<br />
Dim pt As New Point(e.X, e.Y)<br />
<br />
TextBox3.Text = pt.ToString<br />
End Sub
|
|
|
|
|
You need to know two things for this. The coordinate system of .Net is based upon the container you drop something on. This means if you hit on a button you will get the coordinates relative to its top left corner.
However the drag & drop coordinates are absolute, thus from the top left corner of the desktop. To get the coordinates for the drop you will need to translate them to relative coordinates. You can do this with PointToScreen and PointToClient. If correct this should solve you're problem.
Related documentation:
PointToClient
PointToScreen
|
|
|
|
|
Gerben
Thanks for the references - I will look them up.
What confuses me, however, is that each time I run the same program and click at the same spot (I have drawn a small square on it) I get a different result for the .X and .Y properties - I simply can't understand this
Thanks
Wayne
|
|
|
|
|
I get below C# code :
ControlPaint.DrawCheckBox(graphics, rect, ButtonState.Normal | ButtonState.Flat);
How can i specify it in vb.net.
I got error : Invalid Character if i specify button state as above (ButtonState.Normal | ButtonState.Flat).
any idea? Thanks in advance!
Happy New Year 2006
|
|
|
|
|
merlynml,
Did you try the following?
(graphics, rect, ButtonState.Normal or ButtonState.Flat)
I hope that helps.
Happy New Year.
Mohammed.
For more information, please email me at:
support@cyber-institute.net
|
|
|
|
|
thanks! it's working!
|
|
|
|
|
how to access randomly to the content of spicific folder (the path is known), and getting the name of any file found in this folder (choosed randomly) with spicific type of file.
i didn't find any help in the MSDN????
Militiaware
Faris Madi
-- modified at 19:50 Thursday 29th December, 2005
|
|
|
|
|
here is some msdn help....
msdn[^]
also for more info on files, check the other links for files in the sidebar.
Brian Van Beek
Inside this room, all of my dreams become realities, and some of my realities become dreams. -Willy Wonka
Just started a new blog, yeah! [^]
|
|
|
|
|
i want to enable my program to set picture as desktop wallpaper in different types (center, title, stretch)....
what is the class that give these action..
Militiaware
Faris Madi
|
|
|
|
|
Here are some articles[^], they're in C# though...
Laters!
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick || Fold With Us! || Pensieve || VG.Net ||
|
|
|
|
|
When I try to handle MyBase.Click, it is suppose to handle all clicks done on all controls + form right? If not, what to use?
But the problem seems to be that I cannot compare the sender to see what kind of object type I'm dealing with... sender.GetType() seems worthless and something irrelevant, and I have tried different Ifs, like:
If sender Is CType(sender, Panel)
If sender Is Panel
And so on, but it just dont work which is pretty obvious anyways.
Also what if I want to make a Select Case for the sender? How to do this?
I have tried:
Select Case sender
Case Is pnlBack
and different stuffs like that.
Should it be something with CType?
Best Regards,
Hmmkk
|
|
|
|
|
It seems like this works to detect the object type,
Dim ControlType As String
ControlType = Microsoft.VisualBasic.Right(sender.GetType.ToString, Len(sender.GetType.ToString) - (InStr(sender.GetType.ToString, "Forms") + 5))
If ControlType = "Panel" Then
but the problem with handling programmically created controls or all controls still remains...=/ MyBase.Click doesn't work...
Regards,
Hmmkk
|
|
|
|
|
MyBase.Click does NOT handle mouse clicks for the form and everything on it. It only handles the mouse clicks for whatever object MyBase is. There is nothing that handles mouse clicks for the form AND everything on it.
You'd have to specially write the code to attach the Click event for all your controls to the single handler that you're writing. See AddHandler for this. But, this is never recommended. There's actually a performance penalty for routing all the forms controls events through a single Click event handler. It makes for very messy code.
But, there are reasons for do it. For instance, a related group of buttons that all do essentially the same thing could have all their Click events routed to a single Click event handler. See the Handles clause for Event Handlers or the AddHandler and RemoveHandler methods.
Your code for determining object type is grossly convoluted. It works much simpler if you just did:
If TypeOf sender Is object Then
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|