|
Nilish wrote: But specifically with pointers
A reference and a pointer are pretty much the same thing. There are some differences, but not so many that I've ever had to concern myself with them in any practical way.
|
|
|
|
|
Hi there
i have
two forms named form1 and form2
two class files named class1.vb , class2.vb
now in class1 the code is as follows
class class1
protected overrides sub Finalize()
mybase.Finalize
End Sub
end class
class2 code is as follows
class class2
protected overrides sub Finalize()
mybase.Finalize
End Sub
end class
In form1 i am writing the following code
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
dim d1 as new form2
d1.show
End Sub
End Class
In form2 i am writing the following code
Public Class Form2
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
dim d1 as new class1
End Sub
End Class
The startup page is form1
At form1 loads i am getting form2 automatically.
now i am closing the form2 .
Though the object of class1 is declared in form2
ad on closing the form2 , i am not getting the automatic call of the class1 destructor.Rather getting the automatic call of the finalize function of class1 at the form1 (startup page) closing.
Now my question is
1. y the automatic call of the class1 destructor is not getting called on form2 closing because class1 is assigned the memory in form2.
2. Can i call the finalize function of class1 using it's object
like dim d as new class1
d.finalize
i was getting error but.
3.in the finalize function , i am writing
Mybase.finalize
what's the mean of this line.
I know it is a desctructor
Finalize funtion get called automatically when the startup form gets closed.
|
|
|
|
|
Nilish wrote: 1. y the automatic call of the class1 destructor is not getting called on form2 closing because class1 is assigned the memory in form2.
Because object destruction is non-deterministic. This means that you cannot predict when an object that is no longer in use is going to be destroyed and collected. The Finalize code won't get called until the GC gets around to collecting the object. This could take a while. The GC is a bit lazy, but it's very good at it's job when it gets around to doing it.
Nilish wrote: 2. Can i call the finalize function of class1 using it's object
Why? It's very rare that you ever need to put code into the Finalize method. Instead, put your clean up code into the Dispose method instead and call Dispose when your code needs to destroy an instance of the object and free up resources and a known time.
|
|
|
|
|
Hi,
I created one project in .net 2003 and using C1 report,I get the following error:
Could not transform licenses file 'licenses.licx' into a binary resource. (1) : error LC0003 : Unabled to resolve type ''C1.Win.C1Report.C1Report, C1.Win.C1Report, Version=1.1.20023.28, Culture=neutral, PublicKeyToken=c9c7ad9c0a5706c9'
How it can be resolved.
Any help will be highly appreaciated.
Thanks,
SD.
|
|
|
|
|
C1? Is this ComponentOne? If so then you have to speak to them about sorting your licenses out.
|
|
|
|
|
You URGENTLY need to stop using URGENT in your message titles...3 of 4 have URGENT. Please read the forum guidelines.
__________________
Bob is my homeboy.
|
|
|
|
|
I display the xml file data in datagrid control and i also add the extra column in the datagrid control now i want to add the command button in the newly added column cell.please help me.It is urgent for me
|
|
|
|
|
Dim ds As DataSet = New DataSet
ds.ReadXml("FileName Here")
Dim btn As New DataGridViewButtonColumn
btn.Text = "Add New"
DataGridView1.column.add(btn)
BEST LUCK
|
|
|
|
|
dear sir This is my code.I can add the check box by using this code Now i need the Command button.Your code doesnot work.Please hope for kind coperation.
'btn1_click()
'Dim filePath As String
'filePath = "D:\authors.xml"
'dsAuthors.ReadXml(filePath)
'With dg
' .DataSource = dsAuthors
' .DataMember = "Authors"
' .CaptionText = .DataMember
' Dim dtcCheck As New DataColumn("New Column")
' dtcCheck.DataType = System.Type.GetType("System.Boolean")
' dtcCheck.DefaultValue = False
' dsAuthors.Tables(0).Columns.Add(dtcCheck)
'End With
end sub
|
|
|
|
|
I ran the code below that adds a column to an SQL table.
I refreshed Data Sources, but, the new column does not appear.
I refreshed Server Explorer and the new column does not appear.
I tried running the code again and I got:
"Column names in each table must be unique. Column name 'CaseNbr' in table 'Patient' is specified more than once."
so the column did actually get added, but, I can't see it.
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 sqlConnection As New System.Data.SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Patient.mdf;Integrated Security=True;User Instance=True")
Dim str As String = "ALTER TABLE Patient ADD CaseNbr Varchar(50)"
Dim command As New System.Data.SqlClient.SqlCommand(str, sqlConnection)
sqlConnection.Open()
command.ExecuteNonQuery()
sqlConnection.Close()
Close()
End Sub
End Class
|
|
|
|
|
I Think Ur Code is Correct if u have any confusion then please review this Code thanks
Dim cn As New SqlClient.SqlConnection
cn.ConnectionString = "Data Source=ssi-SIQBAL;Initial Catalog=Dummy;integrated Security=SSPI"
cn.Open()
Dim cmd As New SqlClient.SqlCommand
Dim str As String
str = "ALTER TABLE TBL1 ADD HOME varchar(500)"
cmd.Connection = cn
cmd.CommandText = str
cmd.ExecuteNonQuery()
|
|
|
|
|
Is the MDF file listed in your project in Solution Explorer? The problem usually occurs because the .NDF file is being copied to your Release or Debug folders along with your app's .EXE. The Server Explorer is looking at one version of the database (in your project folder) and your code is looking at the other copy of your database in the bin\Release or bin\Debug folder.
Wanna see? Just open your project folder and search all the subfolders for any files with the extension MDF.
|
|
|
|
|
That was the problem.
Another question:
Why is it that in some projects, the .mdf file is in bin\Release
and in other projects, the .mdf file is in the bin\Debug folder?
|
|
|
|
|
It'll be in either depending on which build configuration you use when you hit, well, Build.
|
|
|
|
|
OK, I deleted the Patient.mdf in Server Explorer.
Then I opened a New Connection and browsed to the .mdf file under the output directory (\bin\debug).
Now I can see the new column in Server Explorer.
But, how do I get it to appear in Data Sources of Solution Explorer?
|
|
|
|
|
You don't want to do that. You just have to understand that the Server Explorer will look at the copy of the database in the Project folder and your running code will look at the copy in the bin\ folders.
Why? Because when you build the project, by default, the database in the project folder will be copied to the bin\ folders every time you build the project. This will overwrite the bin\ folder copy, and any changes your code makes to it.
If this is a permanent change you want to make to the project folder copy, either use the SQL Server Management Studio to make the change, or the Server Explorer, or make the change with your code, then copy the bin\folder version up to the project folder.
|
|
|
|
|
Hi everybody
I need help in resolving an issue, as below.
After installing Visual Studio 2005, with SQL Server Express, on my PC; when I try to add a new connection it reports the following error:
"An error has occurred while establishing a connection to the server. When connecting to the SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (Provider: Named Pipe Provider, error: 40 - could not open a connection to SQL Server)"
I am using the following parameters:
Data Source: Microsoft SQL Server (SqlClient)
Server name: Desktop ( this is the name of my PC)
Attach a database file: test.mdf (it is just for an example)
I have un-installed and re-installed the application twice but the problem persists.
I would appreciate any help.
Regards,
|
|
|
|
|
The Data Source should be .\SQLEXPRESS . The server name doesn't need to be filled in at all. And the Attach a database file should list the FULLY qualified path to the MDF file, not just the filename.
|
|
|
|
|
Thanks for the response.
The problem is that the drop-down list in the "Add Connection" dialogbox does not have the SQLEXPRESS Server name. Secondly, I select the attached database file by browse button and so it should not be a problem.
However, the installation of the SQL Server did not offer me to provide or suggest the Server name.
A more deep-down suggestion will be highly appreciated.
|
|
|
|
|
Click the Advanced button in that dialog. Then it's just a matter of filling in the blanks.
|
|
|
|
|
|
does S has any meaning while writing OOPS
object oriented programming S???
Develop2Program & Program2Develop
|
|
|
|
|
Navneet Hegde wrote: does S has any meaning while writing OOPS
Writing "OOPS" is a mistake in the first place. The term is Object-oriented programming[^], OOP.
There is no plural form "OOPs" of OOP. It would be like saying "gardenings" or "tv watchings".
---
single minded; short sighted; long gone;
|
|
|
|
|
Guffa wrote: It would be like saying "gardenings" or "tv watchings".
Borat would say it like that...
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 )
|
|
|
|
|
You just asked this question and it was already answered.
__________________
Bob is my homeboy.
|
|
|
|