Search Results

Search found 62 results on 3 pages for '5yrslaterdba'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • Update a record in L2S and L2E

    - by 5YrsLaterDBA
    I was told in L2S, the code for update and insert are the same, db.InsertOnSubmit(row); db.SubmitChanges(); and L2S will check to see if it is a insert or update and act approprately in the background. Is that true? How about L2E? I tested, looks like in L2E it is not like that. Maybe I did something wrong.

    Read the article

  • C# why datetime cannot compare?

    - by 5YrsLaterDBA
    my C# unit test has the following statement: Assert.AreEqual(logoutTime, log.First().Timestamp); Why it is failed with following information: Assert.AreEqual failed. Expected:<4/28/2010 2:30:37 PM>. Actual:<4/28/2010 2:30:37 PM>. Are they not the same?

    Read the article

  • which techonology is good for my online store?

    - by 5YrsLaterDBA
    I am thinking about build a online store for my wife to sale something. we need database for customer info and goods info. we also need shopping cart for customers to use. I have yrs java experience but no web experience (know a little about jsp and servlet). I am thinking using wicket and other java technologies plus MySQL to build it. but I am open to other options. I am willing to learn new things. what's your expert views? thanks,

    Read the article

  • Linq, how to specify timestamp condition?

    - by 5YrsLaterDBA
    I have a logins table which records all login and logout activities. I want to look at all login activities of a particular user within 24 hrs. how to do it? something like this: var records = from record in db.Logins where record.Users.UserId == userId && record.Timestamp <= (DateTime.Now + 24) select record; record.Timestamp <= (DateTime.Now + 24) is wrong here. I am using C# 3 + L2E.

    Read the article

  • C# hash password create salt question

    - by 5YrsLaterDBA
    If I create salt by using something like this: public class User { private const int Hash_Salt_Length = 8; private byte[] saltBytes = new byte[Hash_Salt_Length]; public User() { RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); rng.GetNonZeroBytes(saltBytes); } .... } The saltBytes bytes array will be different for each session (restart the application). How can I check password to allow user login our application?

    Read the article

  • C# ISerializable question

    - by 5YrsLaterDBA
    I am planning to use serialization to do clone. I have to make my class ISerializable. But how about its super classes and all referenced variable classes? do I need to make them all ISerializable? If I use ISerializable. I have to implement the GetObjectData(), what I should put inside that method? leave it empty is ok?

    Read the article

  • Linq, should I join those two queries together?

    - by 5YrsLaterDBA
    I have a Logins table which records when user is login, logout or loginFailed and its timestamp. Now I want to get the list of loginFailed after last login and the loginFailed happened within 24 hrs. What I am doing now is get the last login timestamp first. then use second query to get the final list. do you think I should join those two queris together? why not? why yes? var lastLoginTime = (from inRecord in db.Logins where inRecord.Users.UserId == userId && inRecord.Action == "I" orderby inRecord.Timestamp descending select inRecord.Timestamp).Take(1); if (lastLoginTime.Count() == 1) { DateTime lastInTime = (DateTime)lastLoginTime.First(); DateTime since = DateTime.Now.AddHours(-24); String actionStr = "F"; var records = from record in db.Logins where record.Users.UserId == userId && record.Timestamp >= since && record.Action == actionStr && record.Timestamp > lastInTime orderby record.Timestamp select record; }

    Read the article

  • can I run C# built-in unit test in build machine?

    - by 5YrsLaterDBA
    can I run C# built-in unit test in build machine which doesn't have Visual Studio installed? We are thinking add unit test to our Visual Studio 2008 C# project. Our build machine doesn't have VS installed and we want to integrate the new unit test with our auto-build system. Is MSTest the executable to launch the Team Test unit test?

    Read the article

  • C# why unit test has this strange behaviour?

    - by 5YrsLaterDBA
    I have a class to encrypt the connectionString. public class SKM { private string connStrName = "AndeDBEntities"; internal void encryptConnStr() { if(isConnStrEncrypted()) return; ... } private bool isConnStrEncrypted() { bool status = false; // Open app.config of executable. System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); // Get the connection string from the app.config file. string connStr = config.ConnectionStrings.ConnectionStrings[connStrName].ConnectionString; status = !(connStr.Contains("provider")); Log.logItem(LogType.DebugDevelopment, "isConnStrEncrypted", "SKM::isConnStrEncrypted()", "isConnStrEncrypted=" + status); return status; } } Above code works fine in my application. But not in my unit test project. In my unit test project, I test the encryptConnStr() method. it will call isConnStrEncrypted() method. Then exception (null pointer) will be thrown at this line: string connStr = config.ConnectionStrings.ConnectionStrings[connStrName].ConnectionString; I have to use index like this to pass the unit test: string connStr = config.ConnectionStrings.ConnectionStrings[0].ConnectionString; I remember it worked several days ago at the time I added above unit test. But now it give me an error. The unit test is not integrated with our daily auto build yet. We only have ONE connectionStr. It works with product but not in unit test. Don't know why. Anybody can explain to me?

    Read the article

  • C# & C++, runtime error when call C++ dll from C#

    - by 5YrsLaterDBA
    I have written a C++ wrapper DLL for C# to call. The DLL was tested and worked fine with my C++ test program. now integrated with C#, I got runtime error and crashed. Cannot use debugger to see more details. The C++ side has only one method: #ifdef DLLWRAPPERWIN32_EXPORTS #define DLLWRAPPERWIN32_API __declspec(dllexport) #else #define DLLWRAPPERWIN32_API __declspec(dllimport) #endif #include "NB_DPSM.h" extern "C" { DLLWRAPPERWIN32_API int WriteGenbenchDataWrapper(string fileNameToAnalyze, string parameterFileName, string baseNameToSaveData, string logFileName, string& message) ; } in the C# side, there is a definition, [DllImport("..\\..\\thirdParty\\cogs\\DLLWrapperWin32.dll")] public static extern int WriteGenbenchDataWrapper(string fileNameToAnalyze, string parameterFileName, string baseNameToSaveData, string logFileName, ref string message); and a call: string msg = ""; int returnVal = WriteGenbenchDataWrapper(rawDataFileName, parameterFileName, outputBaseName, logFileName, ref msg); I guess there must be something wrong with the last parameter of the function. string& in C++ should be ref string in C#?

    Read the article

  • C# call a C++ dll get EntryPointNotFoundException

    - by 5YrsLaterDBA
    I was gaven a C++ dll file, a lib file and a header file. I need to call them from my C# application. header file looks like this: class Clog ; class EXPORT_MACRO NB_DPSM { private: string sFileNameToAnalyze ; Clog *pLog ; void write2log(string text) ; public: NB_DPSM(void); ~NB_DPSM(void); void setFileNameToAnalyze(string FileNameToAnalyze) ; int WriteGenbenchData(string& message) ; }; In my C# code, I have those code: internal ReturnStatus correctDataDLL(string rawDataFileName) { if (rawDataFileName == null || rawDataFileName.Length <= 0) { return ReturnStatus.Return_CannotFindFile; } else { setFileNameToAnalyze(rawDataFileName); } string msg = ""; int returnVal = WriteGenbenchData(ref msg); return ReturnStatus.Return_Success; } [DllImport("..\\..\\thirdParty\\cogs\\NB_DPSM.dll")] public static extern void setFileNameToAnalyze(string fileName); [DllImport("..\\..\\thirdParty\\cogs\\NB_DPSM.dll")] public static extern int WriteGenbenchData(ref string message); I got EntryPointNotFoundException at the setFileNameToAnalyze(rawDataFileName); statement. Few questions: do I need to add that lib file into somewhere of my C# project? how? do I need to add the header file into my C# project? how? (no compile error for now) I would like to remove those "..\\..\\thirdParty\\cogs\\" hardcode path. how to this? how to get ride of that EntryPointNotFoundException? thanks,

    Read the article

  • C# connectionString encryption questions

    - by 5YrsLaterDBA
    I am learning how to encrypt the ConnectionString for our C# (3.5) Application. I read the .Net Framwork Developer Guide (http://msdn.microsoft.com/en-us/library/89211k9b(VS.80).aspx) about securing connection string. but not fully understand the contents. It says "The connection string can only be decrypted on the computer on which it was encrypted." We have a release machine which will build our application which will generate the OurApp.exe.config and then install it to many product machines. Is that meam we have to have this encryption process separated with our application and run it at individual product machine? We may use the "RSAProtectedConfigurationProvider". It mentioned we need encryption key for that provider. when and how we should provide the encryption key? thanks,

    Read the article

  • ecommerce platform evaluation

    - by 5YrsLaterDBA
    Anybody has experience with Magento community version and Appach OFBiz? Could you please share your feeling with me? I am trying to find a free ecommerce platform to start with. OFBiz is using Java. Don't know what's the language Magento is using. thanks,

    Read the article

  • C#, Can I move dictionary initial code out from the constructor?

    - by 5YrsLaterDBA
    Here is my code right now. But I would like to move those "Add" out from the constructor. Can we initialize Dictionary when we new it? or you have another better idea. Basically I want to define few characters which are used in many places. public class User { public enum actionEnum { In, Out, Fail } public static Dictionary<actionEnum, String> loginAction = new Dictionary<actionEnum, string>(); public User() { loginAction.Add(actionEnum.In, "I"); loginAction.Add(actionEnum.Out, "O"); loginAction.Add(actionEnum.Fail, "F"); } ..... }

    Read the article

  • C#, cannot understand this error?

    - by 5YrsLaterDBA
    I am using VS2008. I have a project, SystemSoftware project, connect with a database and we are using L2E. I have a RuntimeInfo class which contains some shared information there. It looks like this: public class RuntimeInfo { public const int PWD_ExpireDays = 30; private static RuntimeInfo thisObj = new RuntimeInfo(); public static string AndeDBConnStr = ConfigurationManager.ConnectionStrings["AndeDBEntities"].ConnectionString; private RuntimeInfo() { } /// <summary> /// /// </summary> /// <returns>Return this singleton object</returns> public static RuntimeInfo getRuntimeInfo() { return thisObj; } } Now I added a helper project, AndeDataViewer, to the solution which creates a simple UI to display data from the database for testing/verification purpose. I don't want to create another set of Entity Data Model in the helper project. I just added all related files as a link in the new helper project. In the AndeDataViewer project, I get the connection string from above RuntimeInfo class which is a class from my SystemSoftware project as a linked file. The code in AndeDataViewer is like this: public class DbAccess : IDisposable { private String connStr = String.Empty; public DbAccess() { connStr = RuntimeInfo.AndeDBConnStr; } } My SystemSoftware works fine that means the RuntimeInfo class has no problem there. But when I run my AndeDataViewer, the statement inside above constructor, connStr = RuntimeInfo.AndeDBConnStr; , throws an exception. The exception is copied here: System.TypeInitializationException was unhandled Message="The type initializer for 'MyCompany.SystemSoftware.SystemInfo.RuntimeInfo' threw an exception." Source="AndeDataViewer" TypeName="MyCompany.SystemSoftware.SystemInfo.RuntimeInfo" StackTrace: at AndeDataViewer.DbAccess..ctor() in C:\workspace\SystemSoftware\Other\AndeDataViewer\AndeDataViewer\DbAccess.cs:line 17 at AndeDataViewer.Window1.rbRawData_Checked(Object sender, RoutedEventArgs e) in C:\workspace\SystemSoftware\Other\AndeDataViewer\AndeDataViewer\Window1.xaml.cs:line 69 at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) .... InnerException: System.NullReferenceException Message="Object reference not set to an instance of an object." Source="AndeDataViewer" StackTrace: at MyCompany.SystemSoftware.SystemInfo.RuntimeInfo..cctor() in C:\workspace\SystemSoftware\SystemSoftware\src\systeminfo\RuntimeInfo.cs:line 24 InnerException: I cannot understand this because it looks fine to me but why there is an exception? we cannot access static variable when a class is a linked class? A linked class should be the same as the local class I think. "Linked" here means when I add file I use "Add As Link".

    Read the article

< Previous Page | 1 2 3  | Next Page >