|
First, please read the post at the top of hte forum on how to ask questions. Everyone here wants help in VB.NET.
Yes, you need to write the SQL that selects the data you want to display from across the tables, by doing joins betwen the tables. If the tables are unrelated, then probably not.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
I am fairly new to VB.net and have been working with regular expressions recently. I was wondering how someone would call a static Regex from a compiled .DLL in an application? I have tried multiple ways to make the regex available from the .DLL, but no luck.
Any information would help.
|
|
|
|
|
Not sure what you mean, how is it in a dll ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi
I am in the process of adding video capture functionallity with the use of the DirectShow API. My program has been written in VB.NET, but due to compatibility issues I have been writing code in C++ so that I can fully access the directshow api.
But I seem to have hit bit of a brickwall in attempting to integrate the code.
I thought it was possible to be able add the c++ project into the VB.NET project, and be able to make function calls from the VB.NET GUI interface with the C++ code. Is this possible?
Another option that I am now considering is exporting the c++ code as a DLL file and from there I can access the c++ as a library file?
Although I would prefer my first suggestion if this is possible?
Any suggestions would be greatly appreciated
Cheers
boyindie
|
|
|
|
|
Yes, you use pinvoke for that, and yes, your C++ code needs to be in a dll. Or, you can make your code C++/CLI, then you can call it directly, but it still needs to be a dll
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am working with VB.Net 2005 looking at an Access 2003 database. When I run my Crystal Report (version 10.0.5.1279) I get a Database Login screen even though I don’t have passwords set at all in this datatbase. Can anyone tell me of a way to stop this from coming up?
Thanks in advance for all of you help.
|
|
|
|
|
I've had a similar issue and was only able to get around it with a rather complicated work around. It has to do with the database you designed the report with no longer being located in the same file structure as it was during design time...which is NEVER once you've deployed it and the report is being run on your client's machine.
I got past the issue by including an access database that contained the same table and field structures as I used during design of my crystal report. Then, before I set the report documents datasource or the crystal viewer's ReportSource property, I do the following:
'My schema database has been downloaded to the CurrentUserApplicationData folder via ClickOnce publish settings
Dim strSchemaPath As String = My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData & System.IO.Path.DirectorySeparatorChar & "SchemaDB.mdb"
'This will set the login info to the schema DB, even though it has no passwords set, so the login screen will not display
cdReportDocument.DataSourceConnections.Item(0).SetConnection(strSchemaPath, "", False)
This workaround seems very silly, and requires the user to download a good sized file when they really shouldn't have to. But I've posted this question in several forums and no one has been able to help me with a better fix. If you find anything better please let me know.
|
|
|
|
|
I need to call NetAPI32 to get domain info on legacy workstations (IE: Win98, etc - DirectoryServices is not avail in 98).
I have the following code. The call to DsGetDcNameAWin5 doesn't error off, but the values are 0. I've tried changing the function declare to (using a pointer) as the last param with no success also:
Private Declare Function DsGetDcNameAWin5 Lib "netapi32.dll" Alias "DsGetDcNameA" (ByVal ComputerName As String, ByVal DomainName As String, ByRef DomainGuid As GUID, ByVal SiteName As String, ByVal Flags As Integer, ByRef lpDomainControllerInfo As IntPtr) As Integer
Could someone please show how to properly call and then extract the data from this .dll?
Sample code:
Private Const NO_ERROR As Short = 0
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef pTo As Integer, ByRef uFrom As Integer, ByVal lSize As Integer)
Private Declare Function lstrlenA Lib "kernel32" (ByVal lpString As Integer) As Integer
Private Declare Function DsGetDcNameAWin5 Lib "netapi32.dll" Alias "DsGetDcNameA" (ByVal ComputerName As String, ByVal DomainName As String, ByRef DomainGuid As GUID, ByVal SiteName As String, ByVal Flags As Integer, ByRef lpDomainControllerInfo As Integer) As Integer
Private Structure GUID
Dim Data1 As Integer
Dim Data2 As Short
Dim Data3 As Short
<vbfixedarray(7)> Dim Data4() As Byte
Public Sub Initialize()
ReDim Data4(7)
End Sub
End Structure
Private Structure DOMAIN_CONTROLLER_INFO
Dim DomainControllerName As Integer
Dim DomainControllerAddress As Integer
Dim DomainControllerAddressType As Integer
Dim DomainGuid As GUID
Dim DomainName As Integer
Dim DnsForestName As Integer
Dim Flags As Integer
Dim DcSiteName As Integer
Dim ClientSiteName As Integer
Public Sub Initialize()
DomainGuid.Initialize()
End Sub
End Structure
Private Function SetDcNameA(Optional ByVal strDomain As String = vbNullString, Optional ByVal strComputer As String = vbNullString) As Boolean
Dim lpBuffer As Integer
Dim dci As DOMAIN_CONTROLLER_INFO
dci.DomainGuid.Initialize()
m_LastError = DsGetDcNameAWin5(strComputer, strDomain, dci.DomainGuid, vbNullString, m_Flags, lpBuffer)
If m_LastError <> NO_ERROR Then
GoTo ErrorHandler
End If
' Recover structure into one we can deal with in VB
'Call CopyMemory(dci, lpBuffer, Len(dci)) 'Doesn't compile
' Transfer contents to member structure.
m_DCI.DomainControllerName = PointerToStringA(dci.DomainControllerName)
m_DCI.DomainControllerAddress = PointerToStringA(dci.DomainControllerAddress)
m_DCI.DomainControllerAddressType = dci.DomainControllerAddressType
m_DCI.DomainGuid = dci.DomainGuid
m_DCI.DomainName = PointerToStringA(dci.DomainName)
End Sub
Private Function PointerToStringA(ByVal lpStringA As Integer) As String
Dim Buffer() As Byte
Dim nLen As Integer
On Error GoTo ErrorHandler
If CBool(lpStringA) Then
nLen = lstrlenA(lpStringA)
If CBool(nLen) Then
ReDim Buffer((nLen - 1))
CopyMemory(Buffer(0), lpStringA, nLen)
'Not sure if this line is correct as well.
PointerToStringA = StrConv(System.Text.UnicodeEncoding.Unicode.GetString(Buffer), VbStrConv.None)
End If
End If
Exit Function
ErrorHandler:
PointerToStringA = ""
End Function
|
|
|
|
|
I am currently studying computer in a local university in my country.
I am using Visual Basic 2008 to develop a program for a Windows computer(desktop) which only have one numeric keypad and does not have any standard keyboard.
I hope that when my program is running but Windows focus on other application, or when my program is running in inactive status, if the user press the '+' button (or other button set by me) for three times on the keypad with fast, Windows will switch to my program immediately.
How can I do that?
|
|
|
|
|
Set a keyboard hook[^] watching for the + key. When it is pressed start a timer. If the + key is pressed two more times before the timer event fires, show your form. Otherwise, do nothing.
|
|
|
|
|
How can I set my simple VB.NET program to start in minimized mode?
My program consist of one form.
|
|
|
|
|
Isn't there an initial state property for the form in the designer ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
Set the window state property of the form to minimized
Regards
Azeem
|
|
|
|
|
i am adding a tool in the existing menu bar
and i can view it in the design mode but unable
to view in runtime.i am using third party
controller (Infragistics).
pls help.
modified on Tuesday, June 24, 2008 10:24 AM
|
|
|
|
|
Not a lot to go on, is there? I suspect a licence issue, but the best bet is to contact Infragistics.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
i can view all other existing infragistic control but
the control i added is invisible.the project is of
another developer i just modifying and upgrading little.
when i first try to open in design view it was giving lots of errors.
but i downloaded infragistic.since then i can view all control except
the control i m adding.
thanx 4 replying
|
|
|
|
|
hey all,
i have an application developed in vb6 and i have to migrate it to vb.net
is there any free tool to help me doing that?
10x a lot
|
|
|
|
|
Visual Studio tries, but I don't know of any better tools. VB6 -> VB.NET is two different languages, some rewrite will always be needed.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi
I too doing the same job ..I didn't find any tool for this conversion.
Try to open the VB6 project file with the Visual Studio,it will ask for upgrade option
It will upgrade some code and leaves a message over the code where it fails.
Happy coding..
|
|
|
|
|
We have a system that we want to switch from SQL server to MySql. Is there a simple way to do that. I thought maybe we could just change the connection string in our app.config file but that does not seem to work.
Any and all advice welcome.
Thanks
Tom
|
|
|
|
|
If that doesn't work, you've used SQL that's specific to SQL Server, or you've used the SQL Server specific classes and need to move to the OleDB ones. Hard to know without you telling us what 'does not seem to work', means.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
You may find the MySql Connector/Net[^] to be useful. Just replace your SqlClient references with the new references for MySql. And as Christian said in his reply to you, as long as you did not use any SQL Server-specific commands you will be good to go.
|
|
|
|
|
OK.. Pardon my ignorance please.. but what do you mean by replace SqlClient references with the new references for Mysql. Can you give me a example ?
Thanks in advance
Tom
|
|
|
|
|
Sure. This is probably how your code using SQL Server looks:
Imports System.Data.SqlClient
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim DatabaseConnection As New SqlConnection("connectionstringgoeshere")
DatabaseConnection.Open()
Dim SQLCommand As New SqlCommand("SELECT * FROM TABLE", DatabaseConnection)
SQLCommand.ExecuteNonQuery()
DatabaseConnection.Close()
End Sub
End Class
Now, after you have downloaded and installed the MySql Connector/Net, open the project's properties, click References, click Add, and add C:\Program Files\MySQL\MySQL Connector Net 5.1.6\Binaries\.NET 2.0\MySql.Data.dll. That's the default directory, it may be somewhere else on your computer. Next, change your code to MySql. I bolded the changes:
Imports MySql.Data.MySqlClient
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim DatabaseConnection As New MySqlConnection("connectionstringgoeshere")
DatabaseConnection.Open()
Dim SQLCommand As New MySqlCommand("SELECT * FROM TABLE", DatabaseConnection)
SQLCommand.ExecuteNonQuery()
DatabaseConnection.Close()
End Sub
End Class
Again referring back to what Christian said earlier, as long as you don't do any SQL Server-specific queries you should pretty much be able to just replace the SQL Server stuff with the MySql stuff. Make sure to update your connection string to be for MySql. (You can also use OleDbConnection if you don't want to use the MySql Connector.)
Hope this helps...
|
|
|
|
|
I am using tableadapters built from the data source so I can't just replace the sql server commands with the mysql commands. I guess I thought I should be able to just change the
connectionstring and provider name in my config file and it would go to the MySql database.
Tom
|
|
|
|