Quantcast
Channel: User MethodMan - Stack Overflow
Browsing latest articles
Browse All 41 View Live

Comment by MethodMan on Call a function in c# at a specific time in a day...

why not just create a scheduled task and have it execute / launch your application

View Article



Comment by MethodMan on Access database , Problems with comma "," and dot "."...

also take a look at a similar post stackoverflow.com/questions/27901356/… also read up on what System.Globalization.CultureInfo.InvariantCulture means

View Article

Comment by MethodMan on C# String Parameters to protect against injection?

have you tried a google search or stackoverflow search on how to construct paramerized query's properly to prevent sql injection, also I would recommend doing all your SQL CRUD Functions on the DB side...

View Article

Comment by MethodMan on support multiple versions of third party library

can't you host a single solution with 3 different projects ? seems to me you are more than doubling your efforts

View Article

Comment by MethodMan on get the value of label in asp:repeater in jquery...

have you tried setting breakpoints? also where are you parsing the result from the database and $("#ContentPlaceHolder1_MessageID").val(); what is this doing? what textbox are you wanting to assign to...

View Article


Comment by MethodMan on Can't set dropdown list selected item

have you set breakpoints and used the debugger..? does it jump into the if(Request line try using just this line of code to find the value in the dropdown based off the value of the...

View Article

Comment by MethodMan on Read Checkboxvalues that were dynamically created in...

Glad I could help @JenniferR

View Article

Comment by MethodMan on Missing asp.net features on IIS 10.0

what updates did you specifically apply? can you be more specific?

View Article


Comment by MethodMan on C# nested dictionaries

LOL @CaptainMarvel thanks man

View Article


Comment by MethodMan on How to add elements in List containing object

I would do a google search on Tuple it's really straight forward what @Maku has posted as an Answer in my Opinion

View Article

Comment by MethodMan on Access GET FromQuery attribute

have you done any searches on the following[FromRoute], [FromQuery], [FromBody] for example?

View Article

Comment by MethodMan on How to create pagination with dots and pure html in...

have you looked at the following stackoverflow.com/questions/23734073/…

View Article

Answer by MethodMan for Floating point numbers C#

In plainer English, the default type assumed by the compiler for the text string 12.502 is double. A double is twice the size of a float and just like a quart can't fit in a pint, a double cannot be...

View Article


Answer by MethodMan for How do I open default browser in fullscreen mode from...

wouldn't the SendKeys need to be ActiveForm.SendKeys.Send("{F11}"); instead of ActiveForm.SendKeys("{F11}");

View Article

Answer by MethodMan for How to filter gridview using TextChanged event?

You could create a JavaScript Function for example: If I have on my control OnClientClick="OnClientSelectedIndexChanged" for example I would write the following:<script type="text/javascript">...

View Article


Answer by MethodMan for "StandardIn has not been redirected" error in .NET (C#)

if you would like to see a simple example of how to write your process to a Stream use this code below as a Template feel free to change it to fit your needs..class MyTestProcess{ static void Main() {...

View Article

Answer by MethodMan for How to get list type elements using reflection in c#

For example if I want to set all of the properties to string.Empty in my class I would do something like this, you could apply the same logic in the foreach loop to get your property types etc.. public...

View Article


Answer by MethodMan for 'ClientScript' is not declared when calling bootstrap...

you need to change it to use the PagePage.ClientScript.RegisterStartupScript(this.GetType(), "alert", "ShowRegPopup();", true);

View Article

Answer by MethodMan for JSON saying null reference but the count is over 0

you do have no RootObject based on your JSON payload I saw immediately that you had { Activity: [..... so you need to change your code to the followingvar huh =...

View Article

Answer by MethodMan for How to highlight a row of multiple list boxes on...

foreach (ListItem li in ListBox1.Items){ li.Attributes.Add("onmouseover", "this.style.backgroundColor='blue';"); li.Attributes.Add("onmouseout" , "this.style.backgroundColor='white';");}foreach...

View Article

Answer by MethodMan for ora-01036 illegal variable name/number c#

Here is what your Query looks like also how come you do not close the opening ( in your Sub Select. I would recommend reading up on some basic Sql Selects. Oracle has very good documentation in regards...

View Article


Answer by MethodMan for Same request parameter several times results in a...

If you are certain that you will always want to use the first param and use en then you can do this as well var langParams = Request.Params["lang"].Split( new string[] {","},...

View Article


Answer by MethodMan for C# integers are not adding successfully to list box

Haley I have shown you something that you can add to avoid having to do all the checks, If you are checking something in a conditional statement for example, if the txtInsert.Text; is empty, check that...

View Article

Answer by MethodMan for Make A Delay For A Few Seconds

decorate your method like this public async Task MyWaitMethod() { await Task.Run(async () => //Task.Run automatically unwraps nested Task types! { Console.WriteLine("Start"); await Task.Delay(5000);...

View Article

Answer by MethodMan for Comparing an int to an array while converting a...

int[] numbers = { 2, 3, 5, 7, 11 };int i = 0;while (i < numbers.Length){ Console.WriteLine(numbers[i]); i++;}Make sure to initialize declared variable int i; or you will get an warning / errorAlso...

View Article


Answer by MethodMan for Change style of selected Text in RichTextBox

WPFif (this.TextEditor.Selection.IsEmpty) this.TextEditor.CurrentFontFamily = SelectedFont;else this.TextEditor.Selection.ApplyPropertyValue(TextElement.FontFamilyProperty, SelectedFont);or another WPF...

View Article

Answer by MethodMan for How to define an Excel macro using C#

Here is an Article that explains what you are trying to do I hope this helpsExcel Macro -Create and Run at Runtime using C#

View Article

Answer by MethodMan for COM-wrapped dll in a classic asp/vbscript file not...

Here is a list of things you may want to checkA: This error means "Invalid class string" -- in other words the call to CreateObject failed because the name object cannot be found by the OLE sub-system....

View Article

Answer by MethodMan for Process doesn't terminate

Take a look on MSDN about Releasing ComObjectsSystem.Runtime.InteropServices.Marshal.ReleaseComObject( excel );also if you are wanting to do something else within that foreach loop I would suggest...

View Article



Answer by MethodMan for INSERT INTO With a SubQuery and some operations

Unless he has a column named OrderBythen he would have to add / assign all values within that Insert especially if the column does not allow for nullssounds like fully qualifying the Insert with the...

View Article

Answer by MethodMan for Update Counter not updating my DataGridView

that's because you need to call the timer.Stop() when you get into RefreshMyForm then after the fill method has completed then call timer.Start() also the time is not accessible outside of this method...

View Article

Answer by MethodMan for Simplest way to read from Excel and Word Files in .NET

If you want to use ODBC and read for a WorkSheet for example follow this simple example this is just one of many different ways to read from Excel OleDbCommand myCommand = new OleDbCommand("Select *...

View Article

Answer by MethodMan for How to display results from XML file on grid view C#?

you could do the following var ds = new DataSet();ds.ReadXml("Path to your xml file");dgvSalary.DataSource = ds.Tables[0];dgvSalary.Refresh(); In this example you would want to have a DataTable...

View Article


Answer by MethodMan for Checking if database exists or not in SQL Azure

Select count(*) from sysobjects where name = 'testdb' returns 0 if not found.put the name of your Database and we will edit the script for you .. all you need to do is copy and paste ok..?here are some...

View Article

Answer by MethodMan for How can C# use a legacy DLL simply without...

in .NET COM is normally done thru Interop in order to register .DLL in .NET they are called Assemblies and that can be done several ways.. by adding references via VS IDE at the project level, or...

View Article

Answer by MethodMan for How can I transform string to UTF-8 in C#?

string utf8String = "Acción";string propEncodeString = string.Empty;byte[] utf8_Bytes = new byte[utf8String.Length];for (int i = 0; i < utf8String.Length; ++i){ utf8_Bytes[i] =...

View Article


Answer by MethodMan for What is the correct way to read a serial port using...

Could you try something like this for example I think what you are wanting to utilize is the port.ReadExisting() Method using System; using System.IO.Ports; class SerialPortProgram { // Create the...

View Article


Answer by MethodMan for I have a error Object cannot be cast from DBNull to...

you need to check if the reader is of type DBNULLCall IsDBNull() on the reader to check the column before attempting to convert it:using (reader = server.ExecuteReader(CommandType.Text, TopIDQuery,...

View Article

Answer by MethodMan for LIKE query with Entity Framework

Would something like this linq query work for you.. ? var matches = from m in db.Customers where m.Name.Contains(key) select m;this should also work I edited my answer.Contains is mapped to LIKE...

View Article

Answer by MethodMan for Should Dispose() be called on ReaderWriterLockSlim lock?

In your class, try to inherit from IDisposable. Look at this class declaration as an example.Change your declaration to this, and of course, add in the rest of your existing code.Public Class Test :...

View Article

Answer by MethodMan for Get Name of User from Active Directory

using System.DirectoryServices.AccountManagement;string fullName = null;using (PrincipalContext context = new PrincipalContext(ContextType.Domain)){ using (UserPrincipal user =...

View Article

Browsing latest articles
Browse All 41 View Live




Latest Images