[Solved] There are more columns in the INSERT statement than values specified in the VALUES clause [closed]

[ad_1] Your problem is that you are attempting to insert 3 values: values(‘{0}’,'{1}’,N'{2}’) Into 4 columns: (nokar,modeledokht,tozihat,username) I believe you meant to do this: values(‘{0}’,'{1}’,N'{2}’,'{3}’) Side note: Always use Command.Parameters instead of parsing your command as string! When parsing the command as a string, you are subjected to SQL injections and errors like the one … Read more

[Solved] how to make an instance of a subclass of type base class C#

[ad_1] When an instance of Motorcycle is seen as as Vehicle, then it, quite naturally, cannot give you access to Motorcycle‘s unique properties. That’s the point of inheritance. To access them, you have to type-cast the instance: Vehicle v = new Motorcycle(); ((Motorcycle)v).MotorbikeEngineVolume = 250; When you cannot be sure the instance truly is a … Read more

[Solved] “Cut out” a specific Text of a file and put it into a string

[ad_1] You can extract the keys and the values and push them into a dictionary that you can later easily access like this: var text = “[Name]{ExampleName} [Path]{ExamplePath} [Author]{ExampleAuthor}”; // You can use regex to extract the Value/Pair var rgx = new Regex(@”\[(?<key>[a-zA-Z]+)\]{(?<value>[a-zA-Z]+)}”, RegexOptions.IgnorePatternWhitespace); var matches = rgx.Matches(text); // Now you can add the values … Read more

[Solved] How to use this function AddToArray? [closed]

[ad_1] There’s an example of how to use the function on the page you linked to: I’ve got a little example available right here: Download Example – (arrays.c – 2kb) I’d suggest you start with that and modify the code until you understand it and can use it for whatever it is you are intending … Read more

[Solved] C# Print an array of strings in the reverse order

[ad_1] Here is one option: static void Main(string[] args) { int num = 0; string[] names = { “Alice”, “Bob”, “Charles”, “Delilah” }; while (num < names.Length) { Console.WriteLine(names.Reverse().ElementAt(num)); num++; } // Prints // // Delilah // Charles // Bob // Alice Console.ReadKey(); } As per the comments it is not optimal to call Reverse() … Read more

[Solved] Convert .exe to injectable Dll

[ad_1] Try this : BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwAttached, LPVOID lpvReserved) { if (dwAttached == DLL_PROCESS_ATTACH) { CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)WinMain, NULL, 0, NULL); //starts the routine in anew thread } return 1; } 0 [ad_2] solved Convert .exe to injectable Dll

[Solved] Why i cant make this series by C code?

[ad_1] You need to something like this. void function(int *); int main() { int g[20],N; // array g local to main funciton printf(“Type N”); scanf(“%d”,&N); function(g); // invoke function by passing array base address as an argument printf(“s[0] is %d\n”,g[0]); // the first three positions of the g array printf(“s[1] is %d\n”,g[1]); // have not … Read more

[Solved] Factorial Code issue

[ad_1] The clever authors of the second snippet are rolling their own method of dealing with a very large number such as 50!. Is rather like a multiprecision library and factorial algorithm rolled into one. The first snippet has no such consideration. Even 21! will overflow a signed 64 bit integral type, with undefined results. … Read more

[Solved] Datetime field in MVC Entity Framework

[ad_1] DateTime picker can be implemented using jQuery’s date time picker. Or if you want an inbuilt MVC datetime picker, modify your code as : Field: [DataType(DataType.Date)] public DateTime EnrollmentDate { get; set; } and then in view <div class=”form-group”> @Html.LabelFor(model => model.EnrollmentDate , htmlAttributes: new {@class = “control-label col-md-2″ }) <div class=”col-md-10”> @Html.EditorFor(model => … Read more

[Solved] How to call a function in LinQ

[ad_1] First of all, this code is incorrect: List<users> userList = getUsers(); public class user { string Name; string Country; DateTime EnrollmentDate; } List<users> should be List<user>. Next to that, the Name, Country and EnrollmentDate should be marked public in order to be accessed. The same goes for the return type of the extract unQualifiedUsers-method … Read more