Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

mdv113

@mdv113
About
Posts
5
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • XmlSchemaValidationException
    M mdv113

    When catching an XmlSchemaValidationException, the debugger shows hidden members like ‘Res’ = ‘Sch_InvalidElementContentExpecting’ and string Args[] with the expected elements. I would like to access these hidden members so that I can create my own error message in my native language. Does anybody know how to retrieve this information? Code fragment: invoked after call to XmlDataDocument.Validate: private void ValidationCallBack(Object sender, ValidationEventArgs args) { if (args.Exception.GetType() == typeof(XmlSchemaValidationException)) { XmlSchemaValidationException ex = args.Exception as XmlSchemaValidationException; textBoxValideer.Text += node.Name + " " + ex.Message + "\n"; } else { textBoxValideer.Text += "\n?"; } } :((

    M.A

    XML / XSL c++ debugging help tutorial question

  • Cannot get data saved to my SQL dbase
    M mdv113

    There are many ways to write data to the db: With SqlDataAdapter: FETCH DATA: SqlConnection con = new SqlConnection( connectionstring); SqlCommand command = new SqlCommand("select* from table", con); SqlDataAdapter adapter = new SqlDataAdapter(command); DataSet set = new DataSet(); adapter.Fill(set); CHANGE DATA: //get row to change DataRow row = set.Select("Columnx = 1"); row("Columnx") = 2; //Write to DB adapter.Update(set); //commit dataset set.AcceptChanges(); INSERT NEW ROW: DataRow newrow = set.Tables[0].NewRow(); newrow("Columnx") = x; newrow("Columny") = y; set.Tables[0].Rows.Add(newrow); adapter.Update(set); set.AcceptChanges(); Connection does not have to be opened nor closed when using adapter. You can also use direct SQL like so.. SqlConnection con = new SqlConnection( connectionstring); SqlCommand command = new SqlCommand("insert into table values(1,2) ", con); con.Open(); command.ExecuteNonQuery(); con.Close();

    C# database learning csharp help tutorial

  • Invoke/Thread Error
    M mdv113

    In Vs2005 dotnet2.0 it is not permitted to access a form control from a different thread then the owner thread. You must use a callback to do this. See http://support.microsoft.com/kb/318604[^] mdv113

    C# help data-structures

  • Serialization problem
    M mdv113

    I don’t really understand what the problem is you are experiencing but I could tell you how I serialize into a binary stream I stream can be send or saved to file. Serializing to XML goes the same way. Note both serializer and deserializer and the object definition of the object to serialize should be the same at the sending and receiving end. To ensure this I simply put the classes in a dll which both sides use. With dotnet 1.x the formatter will give an exception when a version difference is detected. In dotnet 2.0 the formatter will serialize everything it recognizes even if there are version differences. The class to serialize should be declared with [Serializable] /// /// Serialize object to byte array, object must be Serializable /// /// object to serialize /// array public byte[] Serialize(T someobject) { byte[] objectstream=null; BinaryFormatter f = new BinaryFormatter(); MemoryStream stream = new MemoryStream(); f.Serialize(stream, someobject); stream.SetLength( stream.Position); objectstream = stream.GetBuffer(); return objectstream; } public void Deserialize(byte[] stream, out T someobject) { BinaryFormatter f = new BinaryFormatter(); MemoryStream serstream = new MemoryStream(stream); someobject = (T)f.Deserialize(serstream); } Class def of class to serialize: [Serializable] public class SetConfigMessage { public string Name = ""; public string Value = ""; /// /// Config message /// /// /// public SetConfigMessage() { } public SetConfigMessage(string name, string value) { this.Name = name; this.Value = value; } } madv113

    C# help wcf linux xml json

  • GridVew Updation
    M mdv113

    Use the SqlDataSource for this or code it your self. I asume you will not use the SqlDataSource. Steps: 1) fetch the GridViewRowUpdate event 2) compare old and new value 3) create sql statements See sample(you should call your Storedproc with SqlCommand class) Protected Sub GridViewDetectorInstellingen_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridViewDetectorInstellingen.RowUpdating Dim newvals As IOrderedDictionary = e.NewValues Dim oldvals As IOrderedDictionary = e.OldValues 'note TDBP1 is column name in Grid Dim begin As String = newvals.Item("TDBP1").ToString() Dim einde As String = newvals.Item("TDBP2").ToString() Dim oudbegin As String = oldvals.Item("TDBP1").ToString() Dim oudeinde As String = oldvals.Item("TDBP2").ToString() Dim keys As IOrderedDictionary = e.Keys 'Keys are the key columns from the main key of the source table Dim dim1 As String = keys.Item("Dimension1") Dim dim2 As String = keys.Item("Dimension2") Dim kid As String = keys.Item("KID") Dim sql As String Dim pos As Int32 If Not IsNothing(begin) Then If begin <> oudbegin Then pos = begin.IndexOf(":") If pos > -1 Then begin = begin.Remove(begin.IndexOf(":"), 1) End If sql = "update Elementen0 set [Value] = " & begin & " where Dimension1 = " & dim1 & " and Dimension2 = " & dim2 & " and OID = (select ID from Objecten where KID = " & kid & " and Naam = 'TDBP1')" globalstuff.ExecuteNonQuery(sql) End If End If If Not IsNothing(einde) Then If einde <> oudeinde Then pos = einde.IndexOf(":") If pos > -1 Then einde = einde.Remove(einde.IndexOf(":"), 1) End If sql = "update Elementen0 set [Value] = " & einde & " where Dimension1 = " & dim1 & " and Dimension2 = " & dim2 & " and OID = (select ID from Objecten where KID = " & kid & " and Naam = 'TDBP2')" globalstuff.ExecuteNonQuery(sql) End If End If 'no update through SqlDataSource permitted e.Cancel = True 'update is done through code behind so stop editmode Me.GridViewDetectorInstellingen.EditIndex = -1 Me.GridViewDetectorInstellingen.DataBind() End Sub Mdv

    ASP.NET database tutorial question announcement
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups