|
In C# the comparison looks like:
If (dg.DataSource.GetType() == typeof(DataTable)
But in VB I get an error DataTable is a type and cannot be used in an operation.
How to ensure that the type of dg.DataSource ist type DataTable?
Thank in advance for reading
Erhard
Erhard
|
|
|
|
|
Try this
If TypeOf (dg.DataSource) Is Data.DataTable Then
|
|
|
|
|
Thanks, Richard!
Now I got It.
Erhard
|
|
|
|
|
No Prob - just watch out if the datagrid has NO datasource, then you will get an exception, so you must first check if datsource is NULL i think
|
|
|
|
|
Ok, Richard, I did't already. The test for 'Nothing' made no problem. But the comparison of types, I always tried the same sequence like in C#: "...DataType ... Is TypeOf...". That was the error. Thanks again.
Erhard
|
|
|
|
|
hi friends,
i have a code written in VB as addin to excel 2007.
please follow the following steps
1)open excel 2007
2)click on office button (located on topmost left)
3)click on excel options
4)click on addins
5)just below the list of addins you have
a)name,publisher,location etc.
my question is how to add the "publisher" there.
thanks and regards
prashant
|
|
|
|
|
Hi
Using VS2005.
1) How do you set the target framework to 1.1 for a Windows application?
2) How do you to set the target framework to 1.1 for a Smart Device / Windows CE5.0 application?
|
|
|
|
|
1 - you can't
2 - I doubt you can
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Dear friends,
I have made the deployment project. Now I want toplace the uninstall icon in the program floder so when the user clicks ont he uninstall icon the setup should run. the user must not have to go to add/remove program to uninstall the program. how should i do it????
Thanks
Taher
|
|
|
|
|
There is a little bit of work to do here, but you can do it. You need to use the command line windows installer to un-install the product.
So the command line would be something like
msiexec /x {460FB517-716B-4495-B3CE-44799A75D868}
So if you provide a shortcut to something that will run that command it should unstall your product. NOTE the GUID ({460FB517-716B-4495-B3CE-44799A75D868}) that is above can be found when you click on your setup project and then go to properties. It is the ProductCode. This can change if you put out new versions of your installer.
Anyway, I hope that helps.
Ben
|
|
|
|
|
Hi,
I am trying to use an unmanaged dll in VB6. But I am getting error as "Cann't find DLL entry point". Please let me know how can I use this dll in VB6.
Thanks,
-- modified at 5:32 Tuesday 22nd May, 2007
rr
|
|
|
|
|
How could we possibly guess WHY, while you haven't noticed your code at all?!!
|
|
|
|
|
Thanks for your reply. actually i got the solution a bit, but still problem is there. I am using following code to imort the dll.
Private Declare Function MyMethod Lib "C:\Mydll.dll" Alias "MyMethodAlias" (ByRef param As Long) As Long
This is working fine. Now the questions is: Is Alias mandatory?
I have tested with some dll's with out Alias and working fine. And with another dll, giving error with out Alias.
Should we mentions this alias compulsory? Can we give any name for this?
Thanks,
AR Reddy
|
|
|
|
|
The Alias part is there if you want to use a different name in your code from what's exported by the .DLL. If, say, the DLL exports a function called "SomeExportedFunction", but you want to use a shorted name in your code, the Declare would be like this:
Private Declare Function MyShortName Lib "Lib.dll" Alias "SomeExportedFunction" ....
If you get the wrong name for the Alias, or if you don't use the alias, your function name doesn't match the exported name in the DLL, you'll get this error.
|
|
|
|
|
Please send code that how to set timer in form with continue updation.
Mukesh
mukesh
|
|
|
|
|
hello mukesh,
try the
timer1.tick()
event
and set the timer interval, it is displayed in milisecond means if you set it as 1000 then after every 1 second the timer will be in action
put timer1.start()
and then called timer1.tick()
hope it will help.....
Be A Good S/W Eng... Life is swing with you..Enjoy..
|
|
|
|
|
Hai to all,
i want to wirte an application,where more than user in the network can draw a drawing Simultaneously...
|
|
|
|
|
There's tons of examples out on the web. Google for "vb.net shared whiteboard".
|
|
|
|
|
i am trying to encrypt connection string to protect my passward.
how i do it.
ajeet
|
|
|
|
|
Why do you need to encrypt your connection string. It would be hidden after making its exe.
Ok, waiting for more questions.
|
|
|
|
|
No, it wouldn't. The connection string is being stored in an XML text file.
|
|
|
|
|
Thanks for reply. But is replied as it were in VB.
|
|
|
|
|
A string in an .EXE is anything but hidden. Let me show you something -> .NET Reflector[^]
|
|
|
|
|
|
i am facing an error: "can not create activex control."
while creating a activex directory user home folder.
the code is as below:
Dim oContainer As ActiveDs.IADsContainer
Dim oUser As ActiveDs.IADsUser
Dim strFirstName As String
Dim strLastName As String
Dim strSAMAcctName As String
Dim strPassword As String
'Dim oGroup As DictionaryEntry
strFirstName = "First" 'Trim(Me.txtFirstName.Text)
strLastName = "Last" 'Trim(Me.txtLastName.Text)
strPassword = "password"
strSAMAcctName = LCase(Left(strFirstName, 1) & strLastName)
oContainer = GetObject("LDAP://dc=abc,dc=com")
oUser = oContainer.Create("user", "cn=" & strFirstName & " " & strLastName)
oUser.Put("displayName", strFirstName & " " & strLastName)
oUser.Put("FirstName", strFirstName)
oUser.Put("LastName", strLastName)
oUser.Put("sAMAccountName", strSAMAcctName)
oUser.Put("userPrincipalName", strSAMAcctName & "@abc.COM")
oUser.EmailAddress = strSAMAcctName & "@abc.com"
'oUser.homedrive = "U:"
oUser.HomeDirectory = "\\192.168.87.154\Home-drive\" & strSAMAcctName
Try
oUser.SetInfo()
Catch
MsgBox("User Already Exists", MsgBoxStyle.Critical, "UserExists!")
End Try
Try
If oUser.AccountDisabled = True Then
oUser.AccountDisabled = False
oUser.SetInfo()
End If
Catch ex As Exception
MsgBox("Error trying to enable account", MsgBoxStyle.Critical, "Enable Account Failed")
'Me.txtResults.Visible = True
End Try
Try
oUser.SetPassword(strPassword)
oUser.Put("pwdLastSet", 0)
oUser.SetInfo()
Catch ex As Exception
MsgBox("Error trying to enable account", MsgBoxStyle.Critical, "Enable Account Failed")
End Try
Jayesh Talsaniya
|
|
|
|