|
Does anyone know where I caqn go to get a call to object or library for a list of NT users within a domain?
Bob Zagars
Senior Software Engineer
|
|
|
|
|
I wrote a class in vb.net with the necessary modifications so it can be accessed as COM object from other apps such as VB6.
VB6 can access my class and call all methods with no problems. However, when a VB6 user is debugging his/her code and stops his/her running program, the destructor of my COM class doesn't get called (Sub Finalize). My class already has a Dispose method that takes care of all necessary cleanup; however, this method can be called only when VB6 code is running and if user clicks Stop button my class destructor doesn't get called.
Please advice because only way to do clean up right now is to completely close VB6 app and restart again.
|
|
|
|
|
I want to developed application for automatically detecting Video format .can any one help regrding above problem.Pls do reply on frum or personally mail me .
Thanks & Regards,
Amit More
amit.more@pictureal.net
|
|
|
|
|
that's not too hard, at least how i'm thinking of it.
First get the file name however you plan on getting it - filesystem, URL, etc.
<br />
DIM Filename as String = 'get your filename here<br />
'get the last 3 letters/extension of the filename<br />
DIM Extension as String = Filename.Substring(Filename.Length - 3, 3) <br />
<br />
'check extension against known types<br />
Select Case Extension<br />
Case "wmv"<br />
Response.Write("File type is wmv")<br />
Case "avi"<br />
Response.Write("File type is avi")<br />
'etc etc etc<br />
Case Else<br />
Response.Write("Unrecognized video format.")<br />
End Select<br />
Hope that helps.
-------------------
abort, retry, fail?
|
|
|
|
|
I have this problem everytime I run VB.Net copying values onto an Excel spreadsheet.
I do the following:
Dim EXLApp As New Excel.Application
then to finish off
EXLApp .Workbooks.Close()
EXLApp .Application.Quit()
When I look in my task manager Excel is still there. If I run my procedure say 10 times, excel is loaded 10 times. Then I start have Excel problems when load a spreadsheet.
Any ideas or what am I doing wrong?
Thanks in advance
|
|
|
|
|
set your excel object reference to nothing after you call the quit method:
EXLApp.Application.Quit()
Set EXLApp = Nothing
Eric Dahlvang-Programmer
|
|
|
|
|
I have a datagrid that I have populated from a database obviously using an SQL statement. What I want to be able to do, is have the data within the datagrid be accessable.
E.G I want the cells within the datagrid to be underlined and clickable. So that when I click on that cell, it will do something else based on the value of that cell.
Does that make sense?
Thanks for any help.
|
|
|
|
|
You're going to have to manually layout (at least certain parts of) your datagrid using template columns item templates, and turn off AutoGenerateColumns in the properties of the datagrid (if it's on).
A short example would be something like this (inside the html or your datagrid):
<asp:TemplateColumn HeaderText="Link">
<ItemTemplate>
<a href='<%# Container.DataItem("LinkURL") %>'><%# Container.DataItem("LinkName")%></a>
</ItemTemplate>
</asp:TemplateColumn>
Note that LinkName and LinkURL are the names of the fields you're using in your SQL select statement.
Something along those lines should work.
-------------------
abort, retry, fail?
|
|
|
|
|
How can I connect to sql server and (Select - update - insert -Delete) the data using other method than Dataset. I want the connection to be directly to the database and not cache as dataset.
Is it possible to use sqldataadapter to retrive ,update , insert and delete data?
Thanks
|
|
|
|
|
Use an SqlCommand object. Put an SQL query or a stored procedure call in it, and use the ExecuteReader method (for select) or ExecureNonQuery method (for update/insert/delete) to call it.
---
b { font-weight: normal; }
|
|
|
|
|
|
Hi all,
Is there any method by which i can find out if a USB cable is connected to USB port through VB program. It would of great help if someone can guide me with this.
Thanx in advance,
sushma
|
|
|
|
|
A cable?? No there isn't. The USB hub doesn't even know that the cable is there, so how is your code going to figure it out? Devices on the other hand...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanx so much for responding to my post.
i cant even figure out if the USB port is empty?
i will tell u in detail what i am supposed to do in my program.
->There are two options in my GUI, Serial Port or USB port. Depending on which port the user selects i must transmit data through that port.
-> If the user selects Serial port it is pretty simple as even the COM port will be selected by the user.
-> As i had mentioned longback that i am using "USB to RS232 converter" which makes USB port look like a COM port and some COM port number(other than the available physical ports) will be allocated to USB port by the software.
->If USB is selected by the user then i must be able to display an error if the cable is not connected and the user is trying to communicate through that.
-> Usually the last valid port will be the COM port allocated to USB port by the software(USB to RS232 converter). The COM port will be allocated to USB port only after a USB cable is plugged in to the USB port.
-> In my program i will be finding out the last valid port available and that port i will be using for communicating through USB.In case if the USB cable is not plugged in then i will assume someother physical port as the one allocated for USB port.To avoid this error i must find a method by which i can find out what is the COM port number allocated by the software to USB. I am not able to find any method for this . So i thought it will be better if i am atleast able to find out whether USB port is plugged in with a USB cable
Hope you got what is my problem
|
|
|
|
|
In that case, don't worry about the USB cable being plugged in. Since your app is communicating over Serial ports only, no matter what the cable medium is, your app doesn't change if the cable changes. So why are you complicating your code over something your code doesn't care about in the first place?
There is nothing that maps COM ports to what cable they're on, if they are simulated, or implemented on hardware other than actual Serial ports. The driver you installed for the cable puts up the illusion of a Serial port, then quietly sits behind it, translating between serial comm and USB.
If the USB cable can be on any COM port, don't mess with USB. Just go through the COM ports and try to communicate with your target app on each one. If you get a response, you've found the port your need. If not, you'll have to rely on the user to tell you which port to use.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
After looking at msdn and various websites this should work
the sqlcommand object has all the connection info and opens without error
but it fails when trying to execute the reader
With SqlCommand1
.Connection.Open()
'.Parameters.Item(0).Value = TextBox1.Text
.CommandText = "SELECT MATTER_UNO FROM(HBM_MATTER)WHERE (CLNT_MATT_CODE = '" + TextBox1.Text + "')"
.CommandType = CommandType.Text
Dim reader As SqlClient.SqlDataReader = SqlCommand1.ExecuteReader()
'Console.Write(.CommandText)
While reader.Read
Global.Matter_uno = reader(0)
End While
.Connection.Close()
End With
could do with some help
|
|
|
|
|
skippydog wrote: CommandText = "SELECT MATTER_UNO FROM(HBM_MATTER)WHERE (CLNT_MATT_CODE = '" + TextBox1.Text + "')"
You had the right idea starting with the previous line by adding parameters, but you seem to have decided to inject the value from the text box into the SQL directly. You should really read up on some SQL Security, unless you want your server to be 0wn3d: SQL Injection Attacks and tips on how to prevent them.[^]
Now, to your question: What was the error produces. I can see nothing much wrong with the code (apart from the security hole I indicated above)
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
finaly solved it by putting a return parameter into the parameter collection and executescalar() as all I wanted was one field from one row. for the textbox I can write a validation routine that will check the format of the string to be passed but only when the app gets anywhere near to being tested by someone.
thanks for the input
|
|
|
|
|
skippydog wrote: but only when the app gets anywhere near to being tested by someone.
Surely you are someone and you are testing the application all the time. Security is not something to be tagged on at the end. It is something that should be in up front at the start or development and stays all the way through to the end.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
I use DirectX.AudioVideoPlayback to play video, which require any control to be an "owner" in which it plays video. Now I selected to play video in Panel control & wanted to save snapshot/picture of any paused frame. Thats taking picture from movie.
Tell me how can I do this (please include coding if possible)
|
|
|
|
|
AudioVideoPlayback is no longer supported, and won't come out in future versions for .NET 2.0 at least. However, you should be able to render to a texture, which you can then save.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
"However, you should be able to render to a texture, which you can then save."
Please tell me how can I do this in VB.NET with .NET Framework v1.1.
Also whats new in .NET Framework v2.0 about saving pictures from movies.
|
|
|
|
|
Iftikhar Ali wrote: Please tell me how can I do this in VB.NET with .NET Framework v1.1.
I've never done it, I've just read the docs
Iftikhar Ali wrote: Also whats new in .NET Framework v2.0 about saving pictures from movies.
The AudioVideoPlayback namespace is gone. There's nothing new that's good that I know of.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote: I've just read the docs
Please tell me the source of docs.
Christian Graus wrote: The AudioVideoPlayback namespace is gone. There's nothing new that's good that I know of.
Thats really bad, but I think some other namespace will replace it but it cannot be completely removed.
|
|
|
|
|
Iftikhar Ali wrote: Please tell me the source of docs.
They are in the SDK, but I also bought a book.
Iftikhar Ali wrote: Thats really bad, but I think some other namespace will replace it but it cannot be completely removed.
My fear is the new SDK will be WPF, which only runs on XP and higher.
Christian Graus - Microsoft MVP - C++
|
|
|
|