Click here to Skip to main content
15,892,697 members
Everything / Programming Languages / C# 3.5

C# 3.5

C#3.5

Great Reads

by Nithyaduruvan, Sathishkumar_P
This article describes about the export functionality of Excel sheet from WPF datagrid.
by FatCatProgrammer
StarReport: WPF-less GDI+.NET report component.
by Member 7874525
This how you can monitor your database changes
by SREENATH GANGA
Auto updating the exe if the latest exe is available in the network share

Latest Articles

by NikStar
Using OutgoingMessageProperties and OperationContextScope to implement authorization by http header for WCF client that communicates with non WCF-based web services.
by gggustafson
This article is a significant revision to the earlier version and introduces a new version of ViewFile.
by Ashwin. Shetty
.NET Delegates & its 5 different features (Func, Action, Predicate, Converter, Comparison)
by Mansur Kurtov
This article shows how to use reflections in C#.

All Articles

Sort by Updated

C# 3.5 

12 Jan 2010 by #realJSOP
There are several articles on CodeProject that show you how to send email programatically. The rest of what you're asking is simply setting the listbox as a multi-select ListBox and iterating through the ListBox.SelectedItems collection to get the names (or email addresses, or items, whatever).
15 Mar 2010 by #realJSOP
Nobody uses interrupts any more. In fact, I don't think anyone ever did SMTP clients with interrupts when interrupts were in wide use. Why would you want to redesign something that's been done *so many times* for .Net?
10 Jun 2010 by #realJSOP
On the off chance that you want to simply make users log into your application, here are a couple of CodeProject references:User Login For WinForm Applications[^]Multiple Subsequent Main Forms in C# Apps[^]
16 Jun 2010 by #realJSOP
bghad1 wrote:Where should I start looking for information about this?Look here[^]
29 Jun 2010 by #realJSOP
First, I would consider giving the DIV's that contain the data a uniqe ID. After you do that, it's a simple matter to look for the IDs using the htmldocument parsing functionality built into .Net.Alternately, you could use Linq-to-xml and parse it out that way.
5 Jul 2010 by #realJSOP
You could use a longInt, and just store the TimeSpan.Ticks property.
31 Jul 2010 by #realJSOP
Are you playing the swf file into a web browser control? If so, you should be able to set the following on the web browser: It *should* cause the swf do grow with it.
3 Aug 2010 by #realJSOP
Custom app.config[^]
26 Aug 2010 by #realJSOP
Change to a List (as opposed to an ArrayList), and either write the appropriate sort delegates, or use the code from this tip/trick:A Generic Comparison Class for Collection Items[^]BTW, this smells like a homework assignment. Only college instructors would impose moronic...
27 Aug 2010 by #realJSOP
You have to write a driver or a windows service. Keep in mind that admin privildeges are required to manipulate most parts of the file system, and this could be a hassle for your equally clueless users.
31 Aug 2010 by #realJSOP
You could just watch for changes to the config file with a FileSystemWEatcher object, and then re-read the file when a change has been detected.You can write a simple console application to make it easier to debug, and then move the debugged code into your windows service.
15 Sep 2010 by #realJSOP
In the PageLoad method, see if the image exists. If it does, show it.
21 Sep 2010 by #realJSOP
0) You could create a new property in your data item that combines the item text with the enum name, and bind that new property to the listbox item.1) You could create a custom ListBoxItem template that contains an element for the listbox item text AND the enum name, and bind the two fields...
20 Sep 2010 by #realJSOP
You're looking for the WebBrowser control.
22 Sep 2010 by #realJSOP
With the oracle data provider. Just google "c# oracle data provider", and you'll find a link ion the oracle site to download it.Funny how google could have provided you with the answer in less time than you waited for a response here.
22 Sep 2010 by #realJSOP
Buy a book, or spend some time on google.
27 Sep 2010 by #realJSOP
To split a string, do something like this:string myString = "BankID|ExtRef|SeqNum|AC|CurCod|ValDate|OpenBal|ValDate|TrxtRef|TrxType|DC|CashVal|Description|CloseBal|Note"string[] parts = myString.Split('|'); At this point, your string is split into the various parts that are separated...
8 Oct 2010 by #realJSOP
Google "c# credit card payment", and revel in the 554 THOUSAND results you get back.You're probably going to have to pick a service and use their API.
18 Oct 2010 by #realJSOP
have you tried this:List catModel = new List();catModel.AddRange((from BU in CTMapDB.TBL_DIM_BU where BU.si_BUId > 0 select BU).ToArray());
22 Oct 2010 by #realJSOP
When you split the string, you end up with an aray of the various parts that were separated at the specified character. None of the parts that are created contain the split character itself. You can iterate through the resulting array using foreach (or any other hnumber of looping mechanisms in...
15 Nov 2010 by #realJSOP
Why are you trying to handle keydown in the form? Try setting the ActiveControl property to null and see if that helps (I'm not sure it will).Either that, or handle the keydown event in the control and set e.Handled to false in the control's event handler.
17 Dec 2010 by #realJSOP
You could make Project3 start one or both of the other apps if they're not already running, and THEN run its own main form...
22 Dec 2010 by #realJSOP
Looks like string.Substring(1, 5) to me...
24 Dec 2010 by #realJSOP
Try running your app as administrator.
10 Jan 2011 by #realJSOP
Your endless loop is here:while (s.Available == 0) { System.Threading.Thread.Sleep(100);}It goes into that loop and since s.Available cannot possibly change, it just sits and spins in that loop. Of course, you could have determined this if you had gone ahead and used...
18 Jan 2011 by #realJSOP
The 2nd link was in C#. Of course, the code in the article isn't going to be an exact fit for your needs, but being a programmer, you shouldn't have any issues extracting and adapting the code you need from it, right?
3 Feb 2011 by #realJSOP
Maybe you could use part of this article where it generates a random encryption key:Create and Share (with a client app) a Random Encryption Key[^]
8 Feb 2011 by #realJSOP
DO NOT USE TIMER OBJECTS (I say this over, and over, and over again). On a busy system, the timer messages are NOT guaranteed to be sent. Use real threads instead. In fact, you might even want to consider using a thread pool so that only a limited number of threads can be executed at any...
11 Feb 2011 by #realJSOP
Check this link.http://msdn.microsoft.com/en-us/library/ms256097.aspx[^]I think you need to set the line break to \r\n to see an actual line break in your data.
18 Feb 2011 by #realJSOP
Here's a fairly complete solution. Just create a new test Winforms solution, add a few controls, like a textbox, radio buttons etc (essentially, something you can click on), and make sure you add a progreesbar, paste this code into the cs file, and add the iindicated form event handlers in the...
17 Mar 2011 by #realJSOP
Could this be of any help?http://weblogs.asp.net/scottgu/archive/2006/01/15/Building-a-DAL-using-Strongly-Typed-TableAdapters-and-DataTables-in-VS-2005-and-ASP.NET-2.0.aspx[^]Google is free.
22 Mar 2011 by #realJSOP
You can't do this through code. Imagine the security implications that would arise if it was possible.
23 Mar 2011 by #realJSOP
All you have to do is use File.Copy. Of course, you need the appropriate permissions on the other machine to copy a file to a shared folder.
6 Apr 2011 by #realJSOP
I would create a class that represents the record (with all of the columns as properties, and provide an additional property that looks something like this):public XElement AsXElement{ get { XElement value = new XElement("BBid", ...
7 Apr 2011 by #realJSOP
If you're adding one collection to another collection (two List collections for einstance) you just need to do this:List myList1 = new ListList myList2 = new...
20 Apr 2011 by #realJSOP
I think this: paramList.Add(new ReportParameter("Company_Name",dtCompanyInfo.Rows[0]"CompanyName"].ToString()));should be:DataRow row = dtCompanyInfo.Rows[0];paramList.Add(new ReportParameter("Company_Name",row["CompanyName"].ToString()));
5 May 2011 by #realJSOP
For the Convert.ToDateTime call, it's okay (or should be). For the ParseExact call, your format string needs to be this:"M/dd/yyyy h:mm"
10 May 2011 by #realJSOP
As an example of what Nish said, given the class below:public class MyClass{ public string Prop1 { get; set; } public string Prop2 { get; set; } public string Prop3 { get; set; } public MyClass() { Prop1 = ""; Prop2 = ""; Prop3 = ""; ...
27 May 2011 by #realJSOP
Can you use google?WCF (Windows Communication Foundation) Example[^]That link is the first of 43,000 results returned with the search phrase "wcf service with tcp/ip binding codeproject".
1 Jul 2011 by #realJSOP
You simply can't read that much data at once. You're going to have to be more selective iin the data returned from the query. We have a web page that returns no more than 250 records at a time from a 4-million record table.
15 Jul 2011 by #realJSOP
If all of your data will fit in available memory, you could retrieve all of the data you need to display, and then extract only the items that will fit in a page. Psuedo code:0) retrieve data 1) Calculate number of pages you have - Math.Min(1, Math.Floor(records_retrieved /...
26 Jul 2011 by #realJSOP
A good book? Don't waste your money on a book. Just use google.As far as a project, coming up with something on your own will be much more satisfying.
2 Aug 2011 by #realJSOP
You need to write a recursive method:private void ClearAllTextBoxes(Control control){ foreach (Control item in control.Controls) { if (item is TextBox) { ((TextBox)item).Text = ""; } else if (item.HasChildren) { ...
12 Aug 2011 by #realJSOP
RowPosition is defined as a 32-bit integer, and the error you're seeing is the result of trying to assign too large of a value to it.
22 Sep 2011 by #realJSOP
string[] parts = str.Split("\r\n");string merchantNumber = "";string outletName = "";int pos = -1;foreach(string line in parts){ if (line.Contains("MERCHANT NO")) { pos = line.IndexOf(":"); if (pos >= 0) { ...
3 Nov 2015 by #realJSOP
This is an alternative for "Compareing Two Complex objects of same class"
13 Oct 2016 by #realJSOP
My guess is that the specified stored procedure doesn't have a parameter named "@typ_table". Did you misspell the parameter name?
1 Dec 2016 by #realJSOP
Put a try/catch block in your code, and that will give you the opportunity to determine where your problem is:OldDbConnection conn = null;OleDbCommand cmd = null;OleDbDataReader reader = null;string query = "SELECT * FROM userdic";try{ using (conn = new...
5 Dec 2016 by #realJSOP
Put a try/catch block around the call to that method, and in the catch section, display the exceptions message property to the user.
9 Jan 2017 by #realJSOP
The server has to be configured to allow it. You have to contact the DBA that owns the server, and after it's properly configured, he can provide the appropriate connection string. However, any DBA worth his salt won't do as you ask, because it's more secure and auditable to have an outward...
11 Jan 2017 by #realJSOP
I tried it mostly your way and it took 39 seconds. Granted, I don't know the contents of your Stopwatch class, but all mine does is return a TimeSpan when I call my ElapsedTime method. I'm also making only one call to Console.Writeline with a string.Concatendated value. public class...
11 Jan 2017 by #realJSOP
Out of curiosity, I tried a multi-threaded approach running a single app. This too 47 seconds.static void Main(string[] args){ string str = Console.ReadLine(); if (str == "start") { StopWatch sw = new StopWatch(); sw.Start(); ...
11 Jan 2017 by #realJSOP
And finally, I wondered if sharing the same stopwatch might be causing some sort of self-induced delays, so I did this, which resulted in about 49 seconds of elapsed timed.static void Main(string[] args){ string str = Console.ReadLine(); if (str == "start") { ...
11 Jan 2017 by #realJSOP
My final solution - execution time is 0.002 seconds (I would call that "negligible" as far as elapsed time is concerned):static void Main(string[] args){ string str = Console.ReadLine().ToLower(); if (str.Contains("start")) { StopWatch sw = new StopWatch(); ...
4 Apr 2019 by #realJSOP
Instead of trying to "find it on the forum and on the internet", try taking notes in class, and then referring back to them when it's time to do your homework.
22 Apr 2019 by #realJSOP
edit your account profile. should be pretty imple to find.
10 Jun 2019 by #realJSOP
It sounds like you're tryitg to perform "live" updates without having to stop the service and restart. 0) One alternative is to have the service monitor the install folder for changes to referenced DLLs, and have it restart itself when it detects a change.This would eliminate the need to load...
10 Jul 2020 by #realJSOP
All you have to do is learn how to use google. CA1819: Properties should not return arrays - Visual Studio | Microsoft Docs[^]
15 Oct 2015 by $*Developer - Vaibhav*$
http://forums.asp.net/t/1085050.aspx?OnClick+Event+for+Text+Box+in+ASP+NET+with+C+[^]http://stackoverflow.com/questions/10880819/how-to-clear-value-of-all-textbox-on-asp-net-buttons-click[^]
3 Oct 2011 by $aikumar$ Cilamkoti
How can i open a page inside a page without using the IFRAMES or Frames???
26 May 2014 by $ultaNn
I tried below codes to get IP from client machine but fail to get the appropriate IP CODE1Using this code i am getting IP 100.43.0.212of my server where i have uploaded my website private void IPAddress() { IPHostEntry host; string localIP =...
8 Jul 2014 by $ultaNn
I am creating Pdf file from dataset for first time i can create pdf but for the secnd time its giving me this errorhere is my codefor first tim its going to rendercontrol and for the secnd time its giving me this errorpublic void Email() { try { ...
13 Aug 2014 by $ultaNn
i have a website on my server and my company user Proxy server when i try to get IP address from client machine its giving me Proxy IP address not client machine IP address i want to put Proxy server credential in my application to bypass the proxy and get the client machine IPplease...
30 Aug 2015 by $ultaNn
I have a tree view which i am populating from active directory i am trying to implement search in tree view , its returning null while its already fill with Active directory data TreeNode node = TreeView1.FindNode("Txt.Text");
7 Mar 2017 by $ultaNn
I can get pdf to browser , i want it in iframe with out using generic handler byte[] bytes = (byte[])GetData("SELECT * FROM [CME_Attachment] where ID = '" + ActID + "'").Rows[0]["Attachment"]; string name = name.pdf; int FileSize =...
3 Jan 2018 by $ultaNn
how can i use transaction code in below code for multiple query private SqlConnection DBCon { get { return new SqlConnection(ConfigurationManager.ConnectionStrings[" "].ConnectionString); } } protected DataTable ExecuteQry(string Qry) { DataTable dt = new...
12 Aug 2018 by $ultaNn
Error while using NextResult fuction with datareader cannot get second table result and error on second NextResult line " invalid attempt to call nextresult when reader is closed " using (SqlConnection myCon = DBCon) { try { string Qry = @"SELECT...
9 Feb 2016 by .net bigner
protected void gvTimeSheet_DataBound(object sender, EventArgs e) { DataTable dt = new DataTable(); int intUserID = TypeConvert.IsNullInt32(ddlUsers.SelectedValue, 0); DateTime fromDate = Convert.ToDateTime(UCFromDate.selectedDate); DateTime...
15 May 2016 by .net developer123456789
I have a SBS2013 with several Windows 7 clients running Outlook 2013.For some reason the Outlook 2013 clients are not able to sent out mails with attacments larger than 20 MB even though Exchange 2013 seems to be configured for this?? Any helpful feedback is highly appreciated.....
16 May 2016 by .net developer123456789
how can Setvalue something like this :- mykey.SetValue("MaximumAttachmentSize","REG_DWORD","51200"); mykey.SetValue(Name,Type,Data)please help meWhat I have tried:Microsoft.Win32.RegistryKey mykey;mykey =...
26 Jul 2016 by .net developer123456789
"UnsupportedThis version of Visual Studio is unable to open the following projects. The project types may not be installed or this version of Visual Studio may not support them.For more information on enabling these project types or otherwise migrating your assets, please see the details in...
7 Feb 2017 by .net developer123456789
I would ask you for your help! XElement response = myClient.CreateCreditCardCustomerCode(Required parameter1,Required parameter2,Required parameter3,Required parameter4,Required parameter5)I get the following error message is returned:The IXmlSerializable type...
28 Mar 2023 by .net developer123456789
I am writing an application that will automate the sending of E-Mails from a specific mailbox within the account available on Outlook. Currently I am able to get the accounts available by doing:Outlook.Application application = new Outlook.Application();Outlook.Accounts accounts =...
24 Oct 2020 by .Net Perfect Dev
Hello, I have an xml document
11 Sep 2014 by /\jmot
Hello..try this code.. string strTest1 = "code@2011"; string replaceText = "@2014"; string yr = strTest1.Substring((strTest1.LastIndexOf('@')), (strTest1.Length) - (strTest1.LastIndexOf('@'))); string ResultText = strTest1.Replace(yr, replaceText );
13 Sep 2014 by /\jmot
you can do this by using 1. Jqury2.from Code Behind when the button is clicked(btn_Click event)Sol1.you already got it [Solution by MuhammadUSman1]Soln 2by using.button.attribute.add("cssclass","class Name")
9 Oct 2014 by /\jmot
If solution 1 didn't solve your issue then try this...I think you are trying to get access to this text box from a static method, or something like that..try to access..page_load(){string name = txtuser.Text;}
19 Oct 2014 by /\jmot
Check these...But, i'm not sure..will not work in all browsers.Gridview Fixed Headers[^]Grid View with Fixed Header[^]How to Fixed GridView's Header and Footer when scrolling?[^]http://demos.devexpress.com/ASPxGridViewDemos/PagingAndScrolling/Scrolling.aspx[^]
22 Oct 2014 by /\jmot
Server Side validation Using Validator..Page.Validate("ValidationGroup");if (!Page.IsValid) { return; }else { //Your Code Goes Here }
21 Nov 2014 by /\jmot
You can use Query String..Page1.aspxResponse.Redirect("page2.aspx?email="+txtEmail.Text.Trim());or SessionSession["UserEmail"]=txtEmail.text.tostring();page2.aspxif(Session["UserEmail"]!=null && Session["UserEmail"].tostring()!=""){string...
24 Nov 2014 by /\jmot
see these link..you'll get the full code with a demo projects..http://devilswork.wordpress.com/2009/10/13/how-to-make-a-gridview-row-color-cell-color-text-color/[^]Changing the color of a row in a GridView in ASP.NET[^]Change the GridView row color on click without...
25 Nov 2014 by /\jmot
you cant use drdwncompany.SelectedItem and drdwrole.SelectedItemusedrdwncompany.SelectedValue//For Selected Value Memberdrdwncompany.SelecetedItem.Text//For selected Item Textdrdwncompany.SelectedIndex//Selected Index(e.g 0,1,2,3,4 etc)See this link..No mapping exists...
6 Dec 2014 by /\jmot
instead of string[], use List in method2;..public List GerReserveby(List ids, string userName, bool reserveOn) { List liRes=new List(); using (NamesTestDbContext db = new NamesTestDbContext()) {...
6 Dec 2014 by /\jmot
see these...
7 Dec 2014 by /\jmot
use..a select Query Like: select * from table_Name where cDate(Date_column)=cDate(datetime.now)See the link..Insert, Update, Delete in ASP.NET Gridview, DataSource as SQL Server, MS Access (mdb/accdb), XML and Framework as 2.0 / 3.0 / 3.5 / 4.0 (VS...
9 Dec 2014 by /\jmot
i think you used the Total label in the footer template..so you have to check in the Footer Not in the data Row..Like This.. if (row.RowType == DataControlRowType.Footer) { Label Total = (Label)row.FindControl("lblTotal"); }
9 Dec 2014 by /\jmot
See for more Explanation..http://stackoverflow.com/questions/7074/whats-the-difference-between-string-and-string[^]
31 Dec 2014 by /\jmot
why didn't you google it??it's the basic question, i think when you are able to post here then you must be able to search it on google before posting here..Few links here..Passing Data Between Forms[^]Pass value between forms using events[^]Pass value between forms using events[^]
29 Jan 2015 by /\jmot
Ref.Here[^]Other Link Here..http://support.microsoft.com/kb/306162[^]https://persianculture.codeplex.com/[^]http://www.c-sharpcorner.com/Blogs/4676/change-culture-setting-of-calendar-control.aspx[^]
9 Feb 2015 by /\jmot
use DirectoryInfo.Name Property.string str = @"\sub1\sub2\sub3";string dirName = new DirectoryInfo(str).Name;ref.https://msdn.microsoft.com/en-us/library/system.io.directoryinfo.name.aspx[^]http://stackoverflow.com/questions/5229292/get-folder-name-from-full-file-path-c-asp-net[^]
10 Feb 2015 by /\jmot
try..var weekDay1 = DayOfWeek.Thursday;var weeekDay2 = DayOfWeek.Monday;var daysDiff = (7 + (weeekDay2 - weekDay1)) % 7;ref.http://stackoverflow.com/questions/9219083/get-difference-in-days-between-two-weekdays[^]
11 Feb 2015 by /\jmot
Possible solution to UpdatePanel and...
16 Feb 2015 by /\jmot
See.Partial Classes in C# With Real Example[^]http://www.dotnetperls.com/partial[^]http://stackoverflow.com/questions/3601901/why-use-partial-classes[^]
24 Mar 2016 by 0HourCoder
string input = textbox1.Text;Dictionary map = new Dictionary();map.Add("AB", "x");map.Add("Ab", "z");map.Add("aB", "p");string temp = input;foreach (var entry in map){ string key = entry.Key; string value = entry.Value; temp =...
3 Dec 2009 by 0x3c0
Try breaking it down. The left ListBox is simply a bound data source. To move the items, you remove it from the left ListBox and add it to the right.
17 Sep 2014 by 10923679
protected void btn_Click(object sender, EventArgs e) { try { if (FileUpload1.HasFile) { string path = string.Concat((Server.MapPath("~/temp/" + FileUpload1.FileName))); FileUpload1.PostedFile.SaveAs(path); ...
18 Sep 2014 by 10923679
can you please help me with this..i have two table table1 slno name year amount bank address company 1 John 2014 2000 ING oruf Google2 Mik 2014 5000 ING tiejd Micro3 ...
15 Oct 2014 by 10923679
i want to copy a particular cell from gridview to paste in clipboard or text.Name Roll phoneabc 1001 44445554if i click on 44445554(cell of gridview)it should copy and whenever i go to a plain text if i paste there i should get this data(44445554)i guess...