Hi Folks I have this basic code. Dim db As New MyLinqDataContext Dim o As New Order o.OrderName = "Cool Order" db.Orders.InsertOnSubmit(o) db.SubmitChanges() db.Connection.Close() (I originally have tried this on C#) I have an orderid column which serves as a primary key which should update automatically when i insert the record. When the code runs there is no record but the database is not updated. Anyone else having issues with this. Im using the express versions of visual studio 2008. thx in advance.
TechnoDev
Posts
-
Database not updating after using insert on submit with linq. -
How smart is your managementare u being sarcastic or truthful
-
Am I the only one that actually *LIKES* Vista?In the beginning Vista was really tough, especially on the compatibility area in my opinion but they seem to be doing an ok job with all the patches they have release. Im running ultimate edition with little problems
-
How smart is your managementAnd what do you do when your management chooses not to listen to you. and you question your appreciation in your company?
-
Do most developers prefer to work alone or on a teamthis may be somewhat of a silly question but what do you folks think about it.
-
Is Biztalk the most lucrative skill out there?The reason I ask this question is because pretty much anyone who is using this tech at the senior level is in the six figure range. What is your opinion on this and also I hear that sharepoint is lucrative also..whats everyones take on this?Thanks
-
Is it possible to store an encrypted files other than .txt in sql server using AES encryption(C#).IS this at all possible? thanks
-
Is it possible to store an encrypted txt file in sql server using AES encryption.Also can you decrypt the content from the database and recreate the file? thanks in advance.
-
Storing AES encrypted files in SQL Server and retrieving these files to decrypt themHi folks, Ive been working on a little app that lets u choose a file from your PC and encrypts it using AES encryption(Rijndael). The encrypted bytes are stored in Sql Server. I wanted to be able to retrieve the encrypted bytes so I can decrypt them. The process works fine. However when i open the decrypted file I have a ton of gibberish looking characters appended file but the decrypted text is fine. For example, this is what the decrypted text looks like. testing today Õ/þ°A¦ðI.Dº99ï_qýÆ;ßfÞàV¥u> øï_qýÆ;ßfÞàV¥u> øï_qýÆ;ßfÞàV¥u> øï_qýÆ;ßfÞàV¥u> øï_qýÆ;ßfÞàV¥u> øï_qýÆ;ßfÞàV¥u> øï_qýÆ;ßfÞàV¥u> ...... it continues on for a while. Can my goals even be achieved with this method? I have heard there are issues with doing this due to how SQLServer stores binary and padding issues with AES. Here is the code. public string EncryptFileData(string filename) { FileStream fsIn = new FileStream(filename, FileMode.Open, FileAccess.Read); byte[] buffer = new byte[4096]; int bytesRead = fsIn.Read(buffer, 0, buffer.Length); MemoryStream ms = new MemoryStream(); Rijndael alg = Rijndael.Create(); alg.Padding = PaddingMode.None; PasswordDeriveBytes pdb = new PasswordDeriveBytes(@"test", new byte[] {0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76}); alg.Key = pdb.GetBytes(32); alg.IV = pdb.GetBytes(16); try { CryptoStream cs = new CryptoStream(ms, alg.CreateEncryptor(), CryptoStreamMode.Write); cs.Write(buffer, 0, buffer.Length); cs.Close(); byte[] encData = ms.ToArray(); SqlConnection conn = new SqlConnection(Settings1.Default.Properties["str"].DefaultValue.ToString()); conn.Open(); SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "spStoreFileContent"; cmd.Parameters.AddWithValue("@FileName", @"c:\test\test.aop"); cmd.Parameters.AddWithValue("@EFileContent", encData); cmd.ExecuteNonQuery(); conn.Close(); return "Cool Beans"; } catch (SystemException sx)