|
Since it is Singleton the objects are created when there is a call and all future calls are served by the same object. I have used memory profiler and it shows only 1 instance of each object so that is not the issue.
|
|
|
|
|
Yes, Singleton will have only one instance of that class running. However, that's not to say that the objects within it aren't spawning out of control. Using memory profiler will show the full memory useage of the class itself. It won't let you break down the different components. That's why I suggested to use the locals window of VS.
|
|
|
|
|
Seems you are correct. The Handler class that communicates with the UI and DatAccess layer has more than 1 instance which I think should not happen if Remoteserver is Singleton. What do you say?
|
|
|
|
|
hmmmm....I can't think of any "good" reason for it to have multiple instances. Theoretically, the app should only have one data _connection_, but could spawn off new instances until it runs out of memory. Considering that it's singleton, it should only be able to use one instance at a time. Try creating your instance in a global scope and see if that helps. either that, or add a dispose to instance each time it's called. That will mark it for cleanup through the garbage collector. Either way should narrow that down to one active instance. Once that's done, I'd recommend scanning the app again for any other objects that are being handled in a similar fashion.
|
|
|
|
|
Hello,
I have a form with a tab control on it with 5 different tabs. Each tab pulls data from a database. When the tab control is loaded, the first tab is automatically selected. If I go to tab 4, I can see data on that page as well.
I have a command button that saves data to a local database, however, it only saves the data on tabs that I have viewed. How do I set up the tab control so that data can be passed to a database whether or not the tab has been accessed?
Thanks,
Rashar
|
|
|
|
|
how can i change form skin (theme) using dll file
i mean when i run my form under XP my theme form will be vista them with out change windowa
origenal theme .
|
|
|
|
|
>> my theme form will be vista them with out change windowa
If I'm understanding correctly, you just want a different look for your forms. If this is the case, you have to do several steps.
1) Create an image of the way you want the form to look
2) Create a new form in VB
3) Set the background image of the form to your image
4) Set form to be transparent
5) Optional - turn off control bars (especially if you have rounded edges to your custom form)
There's a good write up in Microsoft's C# forums. Other than a few syntax changes, it works for VB too. I haven't tested this myself yet, but the write up was pretty thorough.
|
|
|
|
|
hi friends,
i am suffering with a problem in database programming. my need is to execute a sql scritp using vb.net. i have a file having extension .sql. i want this file to be executed programically.
pls help me.
|
|
|
|
|
' Create a stream to read the sql file
Dim reader As StreamReader = New StreamReader(path)
' Read the contents of the file into a string variable
Dim sqlScript as String = reader.ReadToEnd()
' Execute the sql on the database
Dim command as New SqlCommand(sqlScript, New SqlConnection(connStr))
command.ExecuteNonQuery()
|
|
|
|
|
There's one additional aspect to add to this. If your file was created in Enterprise Manager using "Generate SQL Script" then it's going to have "GO" commands through out it. You'll need to add code to remove that by parsing it line by line. If this is the case, then use something like this:
<br />
'Open Script from file name.<br />
Dim oStreamReader As System.IO.StreamReader<br />
Dim sb As New System.Text.StringBuilder<br />
Dim sTemp As String = ""<br />
oStreamReader = New IO.StreamReader(ScriptName)<br />
<br />
'Loop Through Lines until done<br />
Do<br />
Dim cmd As New SqlClient.SqlCommand<br />
sb = New System.Text.StringBuilder<br />
Do<br />
sTemp = oStreamReader.ReadLine<br />
If sTemp > "" And sTemp <> "GO" Then<br />
sb.Append(sTemp + vbCrLf)<br />
End If<br />
Loop Until (sTemp = "GO" Or oStreamReader.Peek = -1)<br />
<br />
''Execute chunk against database<br />
'oStreamReader.ReadLine()<br />
If sb.ToString > "" Then<br />
Try<br />
cmd.CommandText = sb.ToString<br />
cmd.Connection = cn<br />
cmd.ExecuteNonQuery()<br />
cmd.Dispose()<br />
Catch ex As SqlClient.SqlException<br />
MessageBox.Show(ex.Message)<br />
<br />
End Try<br />
End If<br />
'MessageBox.Show(sb.ToString)<br />
sb = Nothing<br />
'oStreamReader.ReadLine()<br />
<br />
Loop Until (oStreamReader.Peek = -1)<br />
cn.Close()<br />
I just wrote an app last week that did this exact thing.
|
|
|
|
|
you can use
<br />
Imports System.IO<br />
public sub RunSQL<br />
Dim conn As New SqlClient.SqlConnection<br />
Dim sqlCmd As New SqlClient.SqlCommand<br />
Dim sqltxt As String<br />
<br />
conn.ConnectionString = ("Data Source= " + DS + " ;Initial Catalog= " + DB + ";Integrated Security=True")<br />
conn.Open()<br />
<br />
sqltxt = System.IO.File.ReadAllText("SP.sql")<br />
sqlCmd.CommandText = sqltxt<br />
sqlCmd.Connection = conn<br />
sqlCmd.ExecuteNonQuery()<br />
conn.Close()<br />
<br />
this code will read the file once and execute it
|
|
|
|
|
Hi all,
i need to edit file on the target folder and this editing must run in Uninstalling this program
what exaclty shall I do?
|
|
|
|
|
In your setup project open up the Custom Actions Editor. Here you can specify other actions to do during installation or uninstallation. You'll have to make a new .exe to edit the file and place that .exe it in the Uninstall folder here.
|
|
|
|
|
i create new class that display warning message if he find string in text file and this code inside Sub of the class so
how can i call this function from the dll in the setup project while uninstall
Code :
<br />
Imports System.IO<br />
Imports System.Windows.Forms<br />
<br />
Public Class Uninstall<br />
Dim str As String<br />
Public Sub FixDynamics()<br />
str = System.IO.File.ReadAllText("Test.txt")<br />
If str.Contains("Auto") = True Then<br />
MessageBox.Show("Exist txt")<br />
End If<br />
<br />
End Sub<br />
-- modified at 3:26 Thursday 25th May, 2006
|
|
|
|
|
|
hi there,
we have to go front and back as there is option in web pages , can we accomplish in standalone application?
bharath.s
|
|
|
|
|
Are you referring to a windows app? If that's the case then you just set the button to load the appropriate form.
|
|
|
|
|
hi there, i wanted to have that navigating front and back option in windows standalone application. Can that be done?
bharath.s
|
|
|
|
|
hello, i want a form to show me a username i write in a textbox from a database. if i want to search for username: adrian a datagrid will contain all adrian usernames. how can i do this?? thanks alot for all of your help!
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
You need to set up your SQL query to be something like this
strName = "adrian"
sSQL = "Select * from Table where username like '%" & strname & "%'
That search statement will get everything that contains adrian in the username.
|
|
|
|
|
hellow to all ..
i am looking for a code or a artical that can help me format textbox the way i like , for exsample , i wanna the textbox only to recive dig numbers and to attach "-" , after the 3d number ,,
thxx for anyhelp .
|
|
|
|
|
|
i deployed the VB.net program with crystal reports.
but a strange bug appear on client machine.
when the user open the crystal report, the data is printed and everything is fine but when he is scroll down or up, left or right... sudenlly the program become not response and freezed, and he should terminate and restart the application.!!!!1
Faris Madi
Nothing Comes Easy (N.C.E.)
|
|
|
|
|
Hi,
am looking for som1 who has already done or is doing work on "Software estimation tool" am using OP, FP and LOC as sizing techniques and for the remaining am working with COCOMO early-staged estimation, COCOMO II, and UCP's....coding wiz vb.net and SQL Server as back-end.
Thanx
Shai
|
|
|
|
|
Instead of using all the SMS-SPK and acronyms, why not try actually putting your question in full English. Your chances of getting any sort of answer will improve loads!!
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|