.net

Interesting Namespace Examples

Namespaces in .NET are meant to Group logical pieces of code together Prevent conflicts caused by use of common names That said it's fairly open for doing naming that is interesting, funny or just different. Do you have any examples of these different names? I am not looking for Good namespace naming - rather the fun or different...

retrieve specific range of rows in a SQL Server table

Hello everyone, I have a table structure like (OrderID [uniqueidentifier], OrderDesciption [nvarchar]), I am using ADO.Net + C# + VSTS 2008 + SQL Server 2008. The table is big, and I want to let client give me two inputs, begin range index and end range index, and I will return specific rows of the table which is in the range (between b...

Form-only opacity

Hello, First I'm going to show you an image of what I'm trying to recreate in pure NET. Image I recreated the window "Inventory" ,the only thing left is the blue-opacity window ,which shows information. If I use the opacity property then everything on that form has opacity,but on the picture the text doesn't have opacity. How do I m...

Please recommend a Mono (i.e. C#) audio reading library

I'm trying to write a small app that displays the contents of an audio file in the frequency domain. I'm looking for a Mono-compatible library that can read an audio file and give me the contents in a physically meaningful way. Can anyone make any recommendations? ...

.NET Windows 7 Jumplist - Checkbox / Radio Jumplist Item

I would like to create a jumplist item that functions with a tick or round checkmark in front of the option. I am using the Windows API Code Pack for the .NET implementation. I have had a look around the SDK documentation but I couldn't find anything that would enable a tick or round checkmark in front of the Jump List Item. I under...

How to take value click gridview without js?

This below codes give me error below: How to generate this codes help me please!!! Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index protected void gvDepartman_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType....

How to reload an assembly for a .NET Application Domain?

We are loading an assembly (a DLL) which reads a configuration file. We need to change the configuration file and then re-load the assembly. We see that after loading the assembly the 2nd time, there is no change in the configuration. Anyone see what is wrong here? We left out the details of reading in the configuration file. AppDomai...

Need a Switch component controlled via USB port

Hi, I need device switch component which an be controlled by code(.net,C# Or vb) ON/OFF state is enough.. i have code knowledge in C#,.net window application, i need to make a switch that can be controlled using code via USB port ... so that using that switch i will turn on/off electrical devices(fan,light) for a specific time ...

Help to review whether my XML validation code is efficient

Hello everyone, I am checking againtst whether a specific input string are valid (could be used as the value for an XML element) in XML UTF-8 encoding. My goal is to tell which string (from an input string array) is not valid according to XML UTF-8 encoding standard. Here is my code, my current implementation is straightforward -- asse...

How to use a stored procedure in ADO.NET Entity Framework

I have 3 tables; I write a stored procedure in ADO.NET Entity Framework. ALTER PROCEDURE [dbo].[sp_GetDepartmanData] (@departman nvarchar(50)) BEGIN SELECT d.ID, d.Name as DepartmanName, sb.Salary, sb.email, sp.Name, sp.SurName, sp.Phone, sp.Married, sp.Address FROM Departman d INNER JOIN StaffsBusin...

Modify linq query how to?

How can i shorter below codes than before? i need short and simple method: i dont want to use foreach loop because i have one value. public partial class Test : System.Web.UI.Page { StaffManagementEntities staffContext; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) ...

Linq to xml: how do I get subset of elements after performing remove()

If I have code like this (C# or VB.Net does not matter) Dim e As IEnumerable(Of XElement) = _ From s In _dataSourceSettings.Elements _ Where s.Attribute("name").Value = toInsert.Attribute("name").Value If e.Count > 0 Then e.Remove() End If How do I get now new _dataSourceSettings w...

Sorting gridview using ado.net entity framework

i used below code to fill my gridview but i need sorting gridview . How can i do that in Ado.net enttiy framework? (Sorting gridview if filling gridview with ado.net entity ) void LoadStaffPersonel() { int selectedDepartman = Convert.ToInt32(Request.QueryString["SelectedDepartmanID"]); string name = "...

How to reference a self made assembly that is installed in the GAC in visual studio?

I created a homemade assembly and I think I installed it correctly in the GAC using the .Net 2.0 configuration tool (mscorcfg.msu) However, when I want to reference it in visual studio, where do I find it? ( I know, I should not use the GAC anyway, but indulge me ;-)) EDIT: I did not ask the question clear enough: After installing the ...

How can I organize collections of strings in OOP?

I am writing an application that sends command line commands to a 3rd party application. So I have a list of commands like: "process images" "apply effect blur" "save as png" ... I don't know how to best organize them in OOP style. Right now I have: switch ( e.KeyCode ) { case Keys.A: SendCommand ( "process images" ); ...

Control AppDomainSetup when activating AddInToken within AddInProcess

In .net, one can create an AddIn within a new AppDomain. The creation of new AppDomains is nothing new, and one can use an AppDomainSetup class to specify all the startup parameters (such as where to find the app.config) of the newly created AppDomain. However, when activating an AddInToken using a new AddInProcess (which specifies that ...

I have 1 year to learn something useful ( java or .Net ) ?

Hi, Yes I know this is a recursive question. But I have this problem. I have less than 1 year, maybe 8 months and I need to know something usefull. I know little/nothing about linux. Is this a big disadventage for learn java (considering the time I have to learn both if this is necessary) ? So I would be a Junior developer. I'm going...

Drag and drop in ASP.NET

I need to create a new application in which the UI designer decided to heavily use drag and drop. Some of the drag and drop functionality would be: Moving items within a list Moving items to a trash can to delete them Possibly letting users have a "My Page" where users would use widgets to create a personalized page As soon as the us...

Reference a Silverlight Assembly from .NET

I have a .net assembly referencing a Silverlight assembly. The silverlight assembly defines an interface that uses IQueryable. I want to implement this interface in the .NET assembly, but it says I am not implementing the IQueryable method (even though I am). I think this is happening because the interface is using the silverlight IQu...

Microsoft windows Mobile SDK 6.0 target devices?

Hi, I am a c# devoloper and new to windows mobile Devolopment. Now I have to develop an application on Windows mobile 6.0 sdk.So I am learning this from Microsoft’s site. Now my doubt is.. a) what all the commercial mobile devices supports an application developed in windows mobile sdk? or what are the real devices where mobile appl...