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
D

Darell F Butch Jr

@Darell F Butch Jr
About
Posts
6
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • String compressing with System.IO.Compression
    D Darell F Butch Jr

    This code should do the trick: using System; using System.Collections.Generic; using System.Text; using System.IO; using System.IO.Compression; namespace CompressDecompress { class Program { static void Main(string[] args) { string LstrTest = "This is a test"; string LstrOutput; LstrOutput = CompressString(LstrTest); LstrTest = DeCompressString(LstrOutput); Console.WriteLine(LstrTest); } public static string CompressString(string PstrInput) { MemoryStream Lms; GZipStream LstmZipStream; byte[] LbytBufIn; byte[] LbytBufOut; LbytBufIn = Encoding.UTF8.GetBytes(PstrInput); Lms = new MemoryStream(); LstmZipStream = new GZipStream(Lms, CompressionMode.Compress, false); LstmZipStream.Write(LbytBufIn, 0, LbytBufIn.Length); LbytBufOut = Lms.GetBuffer(); LstmZipStream.Close(); return Convert.ToBase64String(LbytBufOut); } public static string DeCompressString(string PstrInput) { MemoryStream Lms; GZipStream LstmZipStream; UTF8Encoding Lutf; byte[] LbytBufIn; byte[] LbytBufOut; int LintRead; LbytBufIn = Convert.FromBase64String(PstrInput); Lms = new MemoryStream(); Lms.Write(LbytBufIn, 0 , LbytBufIn.Length); Lms.Position = 0; LbytBufOut = new byte[LbytBufIn.Length]; LstmZipStream = new GZipStream(Lms, CompressionMode.Decompress); LintRead = LstmZipStream.Read(LbytBufOut, 0, LbytBufOut.Length); LstmZipStream.Close(); Lutf = new UTF8Encoding(); return Lutf.GetString(LbytBufOut, 0 , LintRead); } } }

    .NET (Core and Framework) csharp xml performance question

  • assigning null value
    D Darell F Butch Jr

    Ooooh, now I understand what you are doing. I believe you will have change you logic a little. The DBNull is only a database value. I believe if you change the code to the following this should solve you problem. DataSet Lds; SqlDataAdapter Lda; SqlCommandBuilder Lcb; object[] LaobjValues; string LstrQueryString; using (SqlConnection Lconn = new SqlConnection(@"Data Source=.\DA;Database=Testing;Integrated Security=SSPI")) { Lconn.Open(); LaobjValues = new object[2]; LaobjValues[0] = "5"; LaobjValues[1] = DBNull.Value; LstrQueryString = "Select TOP 0 * From Table1"; Lds = new DataSet(); Lda = new SqlDataAdapter(LstrQueryString, Lconn); Lcb = new SqlCommandBuilder(Lda); Lda.Fill(Lds); Lds.Tables[0].Rows.Add(LaobjValues[0], LaobjValues[1]); Lda.Update(Lds); }

    .NET (Core and Framework) database data-structures help question

  • assigning null value
    D Darell F Butch Jr

    I have tested both techniques and the database has the value: SqlCommand Lcomm; DataSet Lds; SqlDataAdapter Lda; SqlCommandBuilder Lcb; string LstrQueryString; LstrQueryString = "Insert into Table1 (id, name) values (1, NULL)"; using (SqlConnection Lconn = new SqlConnection(@"Data Source=.\DA;Database=Testing;Integrated Security=SSPI")) { Lconn.Open(); Lcomm = new SqlCommand(LstrQueryString, Lconn); Lcomm.ExecuteNonQuery(); LstrQueryString = "Select TOP 0 * From Table1"; Lds = new DataSet(); Lda = new SqlDataAdapter(LstrQueryString, Lconn); Lcb = new SqlCommandBuilder(Lda); Lda.Fill(Lds); Lds.Tables[0].Rows.Add(2, System.DBNull.Value); Lda.Update(Lds); }

    .NET (Core and Framework) database data-structures help question

  • VS2003 / Stored Procedures & SourceSafe
    D Darell F Butch Jr

    If you are using integrated VSS, you could try unbinding the project or solution and re-binding. I know we had this same issue and I believe this is how we solved it.

    Visual Studio database visual-studio help csharp asp-net

  • assigning null value
    D Darell F Butch Jr

    Make sure the table column is define as allowing nulls and doesn't have a default value specified.

    .NET (Core and Framework) database data-structures help question

  • How to make transparency layer for drawing above the textfield?
    D Darell F Butch Jr

    One suggestion and a technique that I have used before is to use another form. On that form you can remove the boarder and set the transparent key. You can also set the Opacity to give a faded look. This technique requires a little more coding to handle but is easier then using APIs. That would be the other option; for that I think will need to get a book.

    C# graphics tutorial question
  • Login

  • Don't have an account? Register

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