|
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.
|
|
|
|
|
Hi Dustin,
many thanks for your response!
It works!
The strange is that now I'm testing my code in a different PC and he works too. I think that you are right! If I understood well, there is the risk that the ThreadPool cannot execute just before the exit, so better to introduce some pause.
Thanks again for you help
Manu
ManuStone
|
|
|
|
|
Hi
I'm using SQL Server 2000 and it is working properly.
But when I use sqldataadapter in VS.NET 2003 and make a connection to database through Data Adapter Configuration Wizard it works fine till making connection,when i generate sql statement through Query Builder in DataAdapter Configuration Wizard and add fields to it and Click Next to see results of SQL Query then it gives this error:
"Generated SELECT Statement"
"cannot generate SSPI context"
I have reinstalled SQL SERVER BUT suggest me should I reinstall VS.NET 2003 Again or is there any solution?
Regards
|
|
|
|
|
i'm sure the last suggestion you said won't paint a smile in your lips
so what is better to do is trying to write the data adapter & configurate it with code
imports system.sqlclient.data
here open your connection & declare your adapter & affect the query to it
if you know how it iks better to work like that i even don't prefer working with the wizar with code you understand better
i hope it wil works
try to be good if you can't be the best
|
|
|
|
|
Sir,
There is a string like "this is a string"
I want to select substring "string" programically.I mean at run time it comes in the label control in the selected format and the remaining substring will be unselected.
Like in msdn library a search keyword is entered .now the result description comes with the search keyword selected i.e having blue background of the search keyword.
Please help me.
Thanks and Regards
amaneet Brar
|
|
|
|
|
Use the "Select" method of the textbox control
i.e.
to select "World" in the string "Hello World" use
TextBox.Select(6, 5)
The FoZ
|
|
|
|
|
Sir,
I have a program containing more then 35 textboxes and have 2 pages .Can you please send me code for checking the preview of the page and finally printing the page.
Thanks and regards
Amaneet Brar
|
|
|
|
|
how to read data from excel file and to push data to sql server
|
|
|
|
|
|
|
To read data fro an excel file use the following I posted earlier (Sory dont know how to put a link in to that post)
Right click on References in the solutions explorer and select add reference.
Click on the COM tab and scroll down until you find "Microsoft Excel Object library". if there are a couple selcet the highest version. This will create a reference to the Excel library.
In your code create some variables below:-
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Create a variable that hold the path of the spreadsheet you want to open (xlFile)
Set the xl Variables
xlApp = CType(CreateObject("Excel.Application"), Excel.Application)
xlBook = CType(xlApp.Workbooks.Open(xlfile), Excel.Workbook)
xlSheet = CType(xlBook.Worksheets([Enter the worksheet name or index]), Excel.Worksheet)
This will create the xlspreadsheet in the background.
You could then populate your dataset etc by interating through the rows and columns by
myVar = xlSheet.Cells(rowIndex, colIndex).Value
then you can send the data to the SQL server.
Hope this helps
The FoZ
|
|
|
|
|
how can i implement birthday remainder
|
|
|
|
|
|
I have a application that does not seem to release memory after opening and closing a new screen. A screen is just usercontrols loaded into a panels. There is a manager to handle this that is rather complex and since I did not write the application I am having a hard time figuring out where to look. In task manager my memory usage for the exe goes from 40 to 100 meg in no time almost 5 meg for every open screen but when they close it does not release the memory.
Does anyone have or know of a tool or technic that I can use to track this down or how I can go about looking for the problem.
Thanks
Joe
-- modified at 9:35 Friday 9th June, 2006
|
|
|
|
|
You can look for a profiler that will show you (among other things) what kind of classes it is that is allocated in the heap.
When controls are used in a form, the form takes care of calling the Dispose method of the controls. If you add and remove controls yourself, you have to call the Dispose method yourself when removing them.
---
b { font-weight: normal; }
|
|
|
|
|
Task Manager is the worst place you can look to see how much memory your app is using. What you're actually seeing is how much memory the virtual machine (.NET CLR) is both using and has reserved for your application. Even though it looks like your app is being a memory hog, it's not. The memory you see as being "used" is actually being reserved, held in the Managed Heap, for future allocations by your application.
Use the Performance Monitor and the .NET Memory counters, or some other profiling tool, to see how much memory your app is actually using.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
What is the affect on the system if that number continues to grow. Like you said it is reserved but doesn't that have the same kind of problem as memory usage, if it keeps taking up the reservations on the heap.
I downloaded ANTS Profiler (trial version) and trying to look at it this way. initially it looks the same ( using memory up ) but I need to use the tool more so I can understand what I am looking at better.
Thanks Dave.
|
|
|
|
|
The .NET CLR will hold onto the memory until either your application allocates more objects or Windows wants memory. In the later case, the CLR will release blocks of memory back to the system until Windows in happy. The .NET Garbage Collector does a really good job of managing memory for you.
Now, that doesn't mean that your app isn't allocating objects and not releasing them! That's where the Profiler comes in handy. It takes a bit of reading the documentation to figure out what you're looking at.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I wrote with VB.NET a service (with sample). It works perfect on the computer where I develop. I can install that service on another computer (with serviceInstaller), but after "net start" I get the error 2186 "Service is not responding to the control function". When I start it from the service windows I get the error 1053. What wrong? Or where can I find a full description of implementing and installing a service?
Thanks for you help
|
|
|
|
|
solution: Installing the .NET Framework
|
|
|
|