|
|
How do I setup project written in vb.net 2003, so application could be ran from the network drive?
David Pudel
pudel.d@dreyfus.com
|
|
|
|
|
First you copy/install the application files onto the network drive.
Next, you must install all of your app's dependencies on to each client system that will run your app. This includes the .NET framework, MDAC (if you're using ADO.NET), any ActiveX or COM objects used, etc. If there are a lot of dependencies, then you might want to write a "Client Installer" for your app to simplify the process for your users.
|
|
|
|
|
hello
i have created a DSN server named "BLTPS" through control pannel ODBC service and using a userid and password property.
now how i will connect to database through my code plz tell me which namespaces i have to add and what is the syntax.
plz help me soon
thanks
|
|
|
|
|
What you need to use is called ADO.NET. It's a collection of .NET classes under the System.Data namespace which allow you to work with various databases. This is a big subject and I highly recommend that you read up on this on MSDN. See the below link.
You should also search this website and the Internet on this subject too. There's plenty of examples out there.
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconoverviewofadonet.asp[^]
That said, you need to use the data provider classes under the System.Data.ODBC namespace. Read the above link to understand how to use them.
|
|
|
|
|
actuualy i have worked on oledb but not on ODBC. i have read a example in it they use ADODB but when i use it in my code it gives me error. there is no namespace of this name how i can use it plz tell me
|
|
|
|
|
iramg wrote: i have read a example in it they use ADODB but when i use it in my code it gives me error.
That's the old ADO library used by VB6 and older versions.
To use ADO.NET, you need to add a reference to the System.Data.dll in your project. In Visual Studio 2003, you can do this by right clicking on your project's References folder, select Add References, select System.Data.dll in the listbox, click Select, and then click OK. This will give you access to the System.Data namespace and all of its classes. You'll need to use the System.Data.Odbc.OdbcConnection class to connect to the database. The below link to MSDN will show you a quick example on how to use this class.
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemDataOdbcOdbcConnectionClassTopic.asp[^]
I hope this helps!
|
|
|
|
|
i have a multi colum ListView i can show data in listview but now i want to save the data in table from listview how can i read data from listview
syed imran azmat
|
|
|
|
|
Dim listItem As ListViewItem
Dim subItem As ListViewItem.ListViewSubItem
For Each listItem In ListView.Items
For Each subItem In listItem.SubItems
...
Your code here
...
Next
Next
|
|
|
|
|
Is there any particular reason why you are using an ODBC provider and not the SQL Server provider in ADO.NET?
Anyway, this code:
OdbcCmd.CommandText = "Call AddMember(?, ?, ?, ?)"
OdbcCmd.CommandType = CommandType.StoredProcedure Appears to be causing the problem. If you use the CommandType.StoredProcedure then the CommandText should contain the name of the stored procedure and nothing more.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Thanks for the reply. I'm new to VB so I haven't seen anything that says to use one or the other and why. I tried your suggestion and I'm still getting an error. Here are the results when I just provice the procedure name:
MSSQLJOB 964-9a4 EXIT SQLExecDirectW with return code -1 (SQL_ERROR)
HSTMT 03A31BC0
WCHAR * 0x010C08E8 [ -3] "AddMember\ 0"
SDWORD -3
DIAG [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure AddMember expects parameter @mbr_acctnum, which was not supplied. (201)
DIAG [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure AddMember expects parameter @mbr_name, which was not supplied. (201)
DIAG [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure AddMember expects parameter @mbr_ssn, which was not supplied. (201)
DIAG [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure AddMember expects parameter @mbr_employee, which was not supplied. (201)
|
|
|
|
|
You didn't answer my previous question: Is there any particular reason why you are using an ODBC provider and not the SQL Server provider in ADO.NET?
If there is a specific provider for your database in .NET (and for SQL Server there is) then use the classes of that provider rather than use ODBC. Use SqlCommand, SqlConnection and so on rather than OdbcCommand, OdbcConnection and so on unless you have a very compelling reason to use the ODBC provider.
Scottish Developers upcoming sessions include:
.NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy
My: Website | Blog
|
|
|
|
|
I have my base form which has background image , tool bar etc,All other
forms inherit it. The background image size is 34kb and it is in Jpeg
format.All the other forms also has many images since we have unique look and
feel. The issue I am facing is performance .
Application works fast when I don't have background image on my base form (
in turn we don't have any background image for any of the form), But when I
apply background image for the base form or individual form , screen loads
slowly ie.. the controls on the screen loads slowly .
is there any way to overcome this problem
Technology - Windows form in VB.Net
Sudheendra
|
|
|
|
|
Hello. I am making a wave player with a playlist, and I'm using the My.Computer.Audio object to play wavs. So I was wondering if there's any method or something that can tell me when a sound is not playing? So I can write code for making it play the next wave in the playlist when the preciding is finished playing. Thanks in advance
----
Dim Sleepy as Boolean = True
If Me.Sleepy = True Then
Goto Sleep
End If
----
|
|
|
|
|
Is there a way of getting the length of a string in pixels based on the current font so you can change the size of a label to fit the text in exactly like the MessageBox.
I'm trying to create my own dialog box that pops up with a user entered message at a specific time. I dont want to limit the user to a certain character length.
Many thanks
The FOZ
|
|
|
|
|
I use this method to adjust the font size so my strings fit in the available width.
Dim ThisFont As Font = AdjustFontSize("Steve", 40, New Font(Me.Font.Name, Me.Font.SizeInPoints, Me.Font.Style))<br />
<br />
<br />
Public Function AdjustFontSize(ByVal s As String, ByVal w As Integer, ByVal LocalFont As Font) As Font<br />
Dim Gr As Graphics = Me.CreateGraphics<br />
Dim ThisFontSize As Single = 15.0!<br />
<br />
Do<br />
ThisFontSize -= 0.5!<br />
LocalFont = New System.Drawing.Font(LocalFont.Name, ThisFontSize, LocalFont.Style)<br />
Loop While (Gr.MeasureString(s, LocalFont).ToSize.Width > w) AndAlso (ThisFontSize > 7.5!)<br />
<br />
Gr.Dispose()<br />
Return LocalFont<br />
<br />
End Function<br />
|
|
|
|
|
Thanks for that. Looks like I can use the MeasureString method to get the results I want.
Ta
The FOZ
|
|
|
|
|
i am devloping s/w in vb.net 2005 and oracle.
on my pc. its running fine..but when i try to copy on the other machine c drive or network drive ..it gives me error that TNS coulnot resolve the service name. actually i am using oracle provider for oracle in microsoft. and importning system.data.oracleclient.dll which is resides in microsoft.framework 2.0 directory. on the other machine they have installed .net framework 2.0. i dont know the problem..why its giving me the problem.
and ofcourse it runs on network drive on my computer. i dont understand that if it is running on network drive on my pc then why not on the other?
if anybody knows the solution , let me know asap.
i've triend tnsnames.ora and all..
but couldnot able to solve this problem//
hemaxi
|
|
|
|
|
Does this other machine have the actual Oracle Client software installed on it?? Without it, the OracleClient namespace won't work. I think the machine has to have MDAC 2.8 SP1 or better installed, then at least Oracle Client 8i Release 3.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Try connecting to the Oracle Database using Sqlplus on the machine you are having problems with. If you can connect, then look for multiple tnsnames.ora file on the machine. Also make sure your Oracle Home points to the right directory in your Environment variables.
Mike Lasseter
|
|
|
|
|
You might want to reply to the OP so he gets a message that you posted a reply.
I'm not having the problem with (gag, puke) Oracle.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
Try connecting to the Oracle Database using Sqlplus on the machine you are having problems with. If you can connect, then look for multiple tnsnames.ora file on the machine. Also make sure your Oracle Home points to the right directory in your Environment variables.
Mike Lasseter
|
|
|
|
|
Hi All,
I'm new to mulththreading concepts in VB.NET (I'm using V1.1).
I understood that calling Th.Join , where th is a Thread object, the calling thread should wait for th finishing his job before continue executing.
Maybe I'm wrong, but when I scheduled in a ThreadPool some writing to console, after a Join in the main thread, nothing is displayed.
In the code below I expected to see "End of TA" followed by "Urka" written to console. But it isn't so. The code exit with "End of TA" only.
I locked everything and Console is thread safe so why "urka" is not displayed?
Many Thanks
Manu
<br />
Imports Microsoft.VisualBasic<br />
Imports System<br />
Imports System.Threading<br />
<br />
Module bub <br />
dim c as Contatore<br />
dim d as Contatore<br />
<br />
<br />
Sub ThreadFuncC(stateInfo as Object) <br />
Dim d as String<br />
d = CType(stateInfo, String )<br />
Console.WriteLine( d )<br />
End SUb<br />
<br />
Sub ThreadFuncA( )<br />
dim s as integer<br />
For s=0 to 20<br />
c.IncrementCounter()<br />
Console.WriteLine("by Thread A {0}", c.GetI())<br />
Thread.Sleep(100)<br />
Next<br />
End Sub<br />
<br />
Sub ThreadFuncB( )<br />
Dim s as integer<br />
For s=0 to 10<br />
d.IncrementCounter()<br />
Console.WriteLine("by Thread B {0}", d.GetI())<br />
Thread.Sleep(200) <br />
Next<br />
End Sub<br />
<br />
class Contatore<br />
Shared Sub IncrementCounter()<br />
SyncLock sync_i<br />
i = i +1<br />
End SyncLock<br />
End Sub<br />
<br />
Function GetI() As integer<br />
SyncLock sync_i<br />
Return i<br />
End SyncLock<br />
End Function<br />
<br />
Shared i as integer = 0<br />
Shared sync_i as object = new object<br />
<br />
end class<br />
<br />
Sub Main() <br />
<br />
c = new Contatore<br />
d = new Contatore<br />
<br />
dim ta As Thread<br />
dim tb as Thread<br />
dim tc as Thread<br />
ta = new Thread(AddressOf ThreadFuncA)<br />
tb = new Thread(AddressOf ThreadFuncB)<br />
tc = new Thread(AddressOf ThreadFuncB)<br />
ta.Start() <br />
tc.Start()<br />
tb.Start()<br />
ta.Join() <br />
Console.WriteLIne("End TA")<br />
Dim f as String = "Urka!!"<br />
ThreadPool.QueueUserWorkItem( AddressOf ThreadFuncC,f ) <br />
End Sub<br />
End Module<br />
ManuStone
|
|
|
|
|
It looks like you call the threadpool right before your program exits. Thread pool threads are background threads and they most likely will not run by the time your program finishes. Put a ReadLine() at the end of your Main and see if that works.
|
|
|
|