|
Im trying to serialize this class (as shown below) but im getting an error
"The type System.Xml.XmlNode is not marked as serialzable". How do i solve this problem?
<serializable()> _
Public Class Alert
Private mNotificationServer As String
Private mNewHour As Xml.XmlNode
|
|
|
|
|
Imports System.Xml.Serialization
<XmlRoot("Testing")> _
Public Class clsTest
Private strName As String
<XmlElement("NameToBeReturnedInXML")> _
Public Property Name() As String
Get
Return strName
End Get
Set(ByVal value As String)
strName = value
End Set
End Property
End Class This is the type of setup if you are wanting to create a strongly typed object that is serialized. The XmlRoot attribute will be the main wrapper around the entire stream. The XmlElement attribute will be each element obviously.
This can get pretty ugly but it is very useful. If you wanted to have multiple employers for a person you could create an Employer class with all the information you want along with the Xml tags. Then you would create the main class and setup an array of type Employer() . You would then create the array of the object (there are other ways, this is how Ive done it) and add that array of Employers to the main class. Then when it is serialized it will do something like the following. (Note I had to remove the < >'s in order for it to show)
UserInformation
Employers
Employer
EmployerName Emp1 /EmployerName
/Employer
Employer
EmployerName Emp2 /EmployerName
/Employer
/Employers
/UserInformation Here a site about the serialization Im showing you[^]
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that.'" - Tommy (Tommy Boy) "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
I have two drop down lists in my aspx page
One is UG and the other PG
If the user selects the PG drop down list before selecting the UG drop down list
an error or warning message should appear
|
|
|
|
|
disable PG drop down... and after selecting the 1st DD then enable PG DD.
Regards,
Smart Boy
Mumbai,
(INDIA)
|
|
|
|
|
Hi,
You can use AJAX for this. It is simple but powerful.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
function isPgSelectedBeforeUg()
{
if ( document.getElementByid("UgName").selectedIndex == 0 )
{
alert("Ug should be filled before Pg");
document.getElementByid("UgName").focus();
return false;
}
else
return true;
}
Put this code on the OnChange event of PG Dropdown.
|
|
|
|
|
hi thanks
i wrote that function
and calling that function with this line of code
Me.ddlpg.Attributes.Add("Onselectedindexchange", "return isPgSelectedBeforeUg();")
but thats not working
can u correct it
Thanks
|
|
|
|
|
I have used a tabcontrol in vb.net and inserted data to some textboxes and comboboxes.I want a crystal report in crystal report-10 showing the values.If the value is not entered then the field heading and the field value should be invisible.How can i do that?
Regards
Subrat Kumar Nayak
|
|
|
|
|
wrote: I want a crystal report in crystal report-10 showing the values
You can do this by adding the value to one XML file and reading the XML file to dataset and set reportsource as this dataset.
wrote: If the value is not entered then the field heading and the field value should be invisible.How can i do that?
To do this I prefer to store the heading too in XML file. When creating XML file , check the value is null. If so make heading also null. Then in reports also heading won't come
|
|
|
|
|
My colleague and I have recently upgraded our projects from .NET Framework 1.0 and VS2002 to .NET Framework 2.0 and VS2005. We also applied the latest VS2005 service pack.
Our problem: normally when debugging we use the QuickWatch window to drill down into and view collections of objects belonging to the parent object we are "watching". THIS NO LONGER WORKS...instead, we get a message in the value line against the object collection saying:
"In order to evaluate an indexed property, the property must be qualified and the arguments must be explicitly supplied by the user."
This is incredibly frustrating, particularly when we have large nested collections of objects.
We are pretty sure this feature was working fine after we upgraded, but we are not so sure that it was working after we applied the VS2005 service pack.
Can anyone suggest any ideas that might help to solve this issue, as it is a massive hinderance to our productivity and our office swear box has been raking it in!!!
Cheers
|
|
|
|
|
Are you debugging a windows forms project, or a web project? Because if you are in a web project, just setting the build to debug mode isn't enough for VS2005. You would need to manually edit the web config to say debug=true instead of debug=false to get the debugger to work.
Otherwise, could you be a little more specific as to what you are quickwatching? Maybe give us the actual code you quickwatch?
Hope this helps.
|
|
|
|
|
I am new to reports so might this question seamed stupid ... I am using Report Application Sever .I create a table and populate all the data required.Now I want to create a cross-tab (pivot table) instead and embed a report within the cell of cross-tab ... is it possible ?
Best Regards,
Madni
|
|
|
|
|
I have created an application which sets IIS.
Now i am trying to install few files in the iis's root directory i.e.(c:\inetpub\wwwroot)
How can i get an iis's root directory path and also
if both versions of .net are installed (1.1 and 2.0) then how can i set to a particular version automatically.
|
|
|
|
|
You'll want to enumerate through the IIS variables using WMI. Try searching for "enumerating IIS directories with WMI"
|
|
|
|
|
hi,
Everyone know this error? the database has been placed in state by user "Admin"!
We are using a shared database in access databases. When more than one user has connect to my databases by my application (my program)the database open, the following error message appears. "The
database has been placed in a state by user 'Admin' on machine XXXXX that
prevents it from being opened or locked."
How to solve this error? please help!
My following code as below:
Try
DB = New OleDbConnection("Provider=microsoft.jet.oledb.4.0; data source=C:\prdsystem\prdnsf.mdb")
DB.Open()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Information, "")
End
End Try
Da = New OleDb.OleDbDataAdapter(sql, DB)
Ds = New DataSet
Da.Fill(Ds, "emp")
|
|
|
|
|
Googled it[^]
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that.'" - Tommy (Tommy Boy) "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
I am using
the following code from VB.NET( I put only necessary lines to be short)
AcroApp = CreateObject("AcroExch.App")
PDDoc = CreateObject("AcroExch.PDDoc")
InsertPDDoc = CreateObject "AcroExch.PDDoc")
PDDoc.Create()
InsertPDDoc.Open(OutPdfPath)
.....
If PDDoc.InsertPages(-1, InsertPDDoc, 0, iNumberOfPagesToInsert, 1) = False Then
MsgBox("Error Inserting Pages ")
Exit For
End If
And this InsertPages(...) work fine for
some documents(that was opened before upon
name InsertPDDoc). But some pdf files the client sent to us are not working.It is
totally depends on pdf file that was opened.
Could you please answer why it is different on different files? The same code could do InsertPages() for one pdf file and could not do for another.
What 'wrong' with that file where it could not do it. I would appreciate any
clue on this.
Thank you.
|
|
|
|
|
Hello!
I would like to know how to encrypt a string before I add it to database? I should be able to decyrpt it when reading back from database.
Any sample or direction is appreciated.
Thank You.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
I use this method: change the 2 constants to whatever you want
Imports System.Text
Imports System.Security.Cryptography
Public Class Encryption
#Region "Public Routines"
const ENCRYPT_KEY AS STRING = "TEST"
const ENCRYPT_VECTOR AS STRING = "CODEPRJT"
Public Shared Function ToBase64(ByVal sDataToEncrypt As String) As String
Dim stream As System.IO.MemoryStream = New System.IO.MemoryStream
Dim key As Byte() = Encoding.Default.GetBytes(ENCRYPT_KEY.PadRight(24, Chr(0)))
Dim Vector As Byte() = Encoding.Default.GetBytes(ENCRYPT_VECTOR.PadRight(8, Chr(0)))
Dim des As TripleDESCryptoServiceProvider = New TripleDESCryptoServiceProvider
Dim cryptoStream As CryptoStream = New CryptoStream(stream, des.CreateEncryptor(key, Vector), CryptoStreamMode.Write)
Dim Input() As Byte = Encoding.Default.GetBytes(sDataToEncrypt)
cryptoStream.Write(Input, 0, Input.Length)
cryptoStream.FlushFinalBlock()
Return Convert.ToBase64String(stream.ToArray())
End Function
Public Shared Function ToBase32(ByVal sDataToDecrypt As String) As String
Dim stream As System.IO.MemoryStream = New System.IO.MemoryStream
Dim key As Byte() = Encoding.Default.GetBytes(ENCRYPT_KEY.PadRight(24, Chr(0)))
Dim Vector As Byte() = Encoding.Default.GetBytes(ENCRYPT_VECTOR.PadRight(8, Chr(0)))
Dim des As TripleDESCryptoServiceProvider = New TripleDESCryptoServiceProvider
Dim cryptoStream As CryptoStream = New CryptoStream(stream, des.CreateDecryptor(key, Vector), CryptoStreamMode.Write)
Dim Input() As Byte = Convert.FromBase64String(sDataToDecrypt)
cryptoStream.Write(Input, 0, Input.Length)
cryptoStream.FlushFinalBlock()
Return Encoding.Default.GetString(stream.ToArray())
End Function
#End Region
End Class
-- modified at 22:28 Thursday 15th March, 2007
|
|
|
|
|
Thank you vey much I really appreciate it.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Sorry for bothering you but when I used your class, I started getting an error message
Specified key is a known weak key for 'TripleDES' and cannot be used."} .
I changed these two constants
const ENCRYPT_KEY AS STRING = "NEMESIS"
const ENCRYPT_VECTOR AS STRING = "DOMAIN"
What is causing the problem?
Thank You.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
i think it's saying that "domain" is word that shouldn't be used because it's like reserved word. try "dom.ain"
you have upto 24 characters for the key and 8 characters for the vector. my key has period, underscores, dashes, etc in it.
|
|
|
|
|
Thanks for replying but it is giving me the same error message even I use another keyword and vector values...
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
i think it follows the rules of "complex password" where just letters are not enough
ex of one of my apps:
Const EncryptKey As String = "THE_XXXX_APPLICATION"
Const EncryptVector As String = "X.X.X.X."
takes it fine...
|
|
|
|
|
How do I move the rows of a dataview into a datatable?
thanks!
|
|
|
|