|
You can also try this code
<br />
Dim moReturn As Management.ManagementObjectCollection<br />
Dim moSearch As Management.ManagementObjectSearcher<br />
Dim mo As Management.ManagementObject<br />
moSearch = New Management.ManagementObjectSearcher("Select * from Win32_PhysicalMedia")<br />
moReturn = moSearch.Get<br />
For Each mo In moReturn<br />
MsgBox(Trim(mo("SerialNumber")))<br />
Next<br />
regards
Mubashir
|
|
|
|
|
hi
thx for your help,
but the VB.Net didn't recognize the "Management.ManagementObjectCollection"
do i need to import anything for it to work?
thx again for your help;)
i do Appritiate it
|
|
|
|
|
You need to import System.Management
You have to select
Project Menu --> Add Reference --> .NET tab --> System.Manegement
|
|
|
|
|
it did work
thx a lot
|
|
|
|
|
I'm taking a VB.Net course. I've written several ASP.Net apps. My employer gave me a new PC with Windows XP and now I can not get into any of the programs I wrote, all were working on the old PC.
The message is:
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
It points to this line of code in the webconfig file:
<authentication mode="Windows">
On both the old and the new PC my code is on the C drive in INETPUB/WWWROOT
|
|
|
|
|
open your IIS . right click on the project folder and click properties. Press the Create Button on the pop window selected tab. click ok and try now it will work.
Rizwan Bashir
|
|
|
|
|
thanks, but I can't find anything like a Create Button.
By project folder - do you mean the folder .VBPROJ?
When I right click on properties I the tabs are GENERAL SECURITY and SUMMARY. I check all the other folders , dont see any create button
|
|
|
|
|
Hi
At site http://www.windowsforms.net/FAQs/default.aspx?PageID=3&CategoryID=3&SubcategoryID=4 under the link "How do I create a ComboBox column in a DataGrid?"
they say that you cannot have the ComboBox bound with the same
BindingContext to the same datasource as the datagrid. I wounder why and
what they mean with not the same BindingContext, the DataSource or the DataMember or what
Thanks for answers
Fia
|
|
|
|
|
vb 6 .. long time back.. well I remember that there are two functions
1. DateFormat
2. Format
use either of them to set the date format. format will be "dd/MM/yyyy"
Rizwan Bashir
|
|
|
|
|
Hi,
I am stuck with this problem for weeks. To put it simple, for example, I have two related tables in MS SQLServer 2000 express: Author and Publications. The Publications table has a foreign key author_id and its primary key is of type int, which Identity is set to "Yes", Seed is set to "0". After playing with the tables for a while, when I use the addnew() to add a new record in the "Publication" table, the index number of the author_id always give me a wrong number: 2 more than the desired number. For example, I have the last record with author_id = 100 in my database, when I try to add the new record, it always give me the author_id of 103. So after update(), there are two records shown here, one with author_id 101 and the other 103. Of course the 103 is wrong, and if I keep working with this fake record, an error with occur. I have to close the form and reopen it, then only the desired record with author_id 101 shown up. The following is the addnew function I used:
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Me.BindingContext(DsAuthorPub, "Author.AuthorPub").EndCurrentEdit()
Me.BindingContext(DsAuthorPub, "Author.AuthorPub").AddNew()
End Sub
Could anyone please give me some hint why I have this problem and how to deal with it?
Thanks alot,
VBDotNetNewbie
VBDotNetNewbie
|
|
|
|
|
Sorry for the confusion of the question I just posted, what doesn't show right is the "publication_id" not the "Author_id".
VBDotNetNewbie
|
|
|
|
|
Someone to help me with a vb6 code that can save Picture into an access/SQL Server database.
Presently i save the Picture Path as a string inside the database table but i want the actual picture to be saved as part of the table.
What is the implication of saving picture inside access table?
t.aransiola
|
|
|
|
|
Not Sure on the implication or the how to do the above task... what are you trying to use this picture int he database for? I might have a few Ideas on how to accomplish the same thing without the hastle of figuring this out.
Michael
|
|
|
|
|
i want to save the picture inside the database because saving the picture using the picture filename, once the picture filename or pathname is tampered with the picture will not show on my vb form
i have done this in vb.net 2003 and is working, is just that i have a vb6 application that i want to do the same
thanks
t.aransiola
|
|
|
|
|
Search for BLOB's at www.msdn.microsoft.com. I'd do it for you but I'm here on my mobile I've had the same question before and that's the answer I got.
|
|
|
|
|
i dont know how to do it in vb but in vb.net if u want to store picture in Sql or access , u first have to convert ur picture in binary format , then store it in sql / access in [image] field. and to vice-versa to show in ur form.This is all u have to do to store pics in database.
I think it works for u .
|
|
|
|
|
i have created a client/server application that stores some data to the databade @ the server,the problem is whenever i try to install the application on another system it shows an unhandled exception & states tht the particular field cannt be found but reconfiguring the data adapters solve the problem. How to overcome this situation.?????
|
|
|
|
|
you can use an application .config file to specify the location of the database then refer to the application .cofig file when pointing to the database with your connection string. To get to the app.config file ... right click, add new item, app.config... then open it you should see something like mine below. The easiest way to get a good connection string for <add key...="" is="" to="" use="" your="" data="" adapter="" and="" just="" copy="" the="" conn="" string="" in="" field="" connection="" string.
hope="" this="" helps="" .
ex.
<?xml="" version="1.0" encoding="utf-8" ?="">
<configuration>
<appsettings>
<add key="odaCustomer.ConnectionString" value="Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Database Password=;Data Source="\\Sfssv01\userapps\SFS OTR Rate Prg\dbsharp.mdb";Password=;Jet OLEDB:Engine Type=5;Jet OLEDB:Global Bulk Transactions=1;Provider="Microsoft.Jet.OLEDB.4.0";Jet OLEDB:System database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Share Deny None;Jet OLEDB:New Database Password=;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;User ID=Admin;Jet OLEDB:Encrypt Database=False">
<add key="mskPhone.Visible" value="True">
Ex. Conn String (Access) "if need another database tell me..."
'Place This in a Module
Public cnnRate As New OleDb.OleDbConnection
Public odaCustomer As New OleDb.OleDbDataAdapter
Public Sub Connect()
Try
cnnRate.ConnectionString = _
System.Configuration.ConfigurationSettings.AppSettings("odaCustomer.ConnectionString")
Catch ex As Exception
MsgBox(ex)
End Try
Michael
|
|
|
|
|
Also ... if you have plans for deployment and other issue's let me konw so i can tell you about other small details that might get in your way. The idea above allows for configuring the connection string at any point after installation... you can simply open the app config file after install with notepad and change the small section refering to connection string. Then its fixed
Michael
|
|
|
|
|
hi,
can you guys suggest me an alternative for checking whether an object is Nothing ?
i don't want to use the below code...
if Not objTemp is Nothing then
.
.
.
end if
thanx!
Najmun
|
|
|
|
|
If IsNothing(objTemp) Then
MsgBox("I found another way of testing nothing")
End If
Rizwan Bashir
|
|
|
|
|
We just upgraded from VS2003 to VS2005 and we've been having some conversion errors.
For this line of code:
origDV.RowFilter = String.Format("Weight < {0} OR Diameter <{1}", Leg.LookupTotalWeight(), Leg.LegWidth) ' + CStr(Leg.LookupTotalWeight()) + " OR Diameter <" + CStr(Leg.LegWidth)
We are getting the error 'Cannot convert System.Decimal to System.SqlTypes.Double'
Any ideas on how to correct this? We're not finding a lot of information.
|
|
|
|
|
Converting from decimal to double is a narrowing conversion with potential for losing precision but not information about the converted value. It's bad casting but it won't throw you an exception. Try declaring your decimal value as double instead.
|
|
|
|
|
I was wondering the best way to go about importing the read only property to the mask edit boxes from VB6. I would like to know the same about a Combo Box as well... If I could get teh basic Idea for adding the Read Only Property to a control I could figure the rest out on my own.
|
|
|
|
|
hi,
I have small query, i want the database server to send a message to the client application on updation of certain records on the ms sql database server.
Plz help me in resolving this issue.
Thanks in advance.
Riz
|
|
|
|