Go Premium for a chance to win a PS4. Enter to Win

x

.NET Programming

132K

Solutions

38K

Contributors

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

Share tech news, updates, or what's on your mind.

Sign up to Post

Is it possible to modify a DataGridView and for columns that correspond to multiple values in a database table ... provide the values in a combo box control so the end user can select which value they want at runtime?  Along with this I am also wanting a way to update the datasource so that the selections are preserved in the DataGridView until they are committed to the database.

Looking for some great examples for doing this.

C# Windows Form application, not web.
0
Windows Server 2016: All you need to know
LVL 1
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

I've read a lot of links about hidden filed bout checkbox I've decided use custom htmlhelper but at the moment, I can't see checkbox in my page when I remove checkbox word in type="checkbox" it's shown as a textbox I think it's sensitive about type of control that is name checkbox.
public static class HelperUI
{
    public static MvcHtmlString CheckBoxSimpleFor<TModel>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, bool>> expression, object htmlAttributes)
    {
        string checkBoxWithHidden = htmlHelper.CheckBoxFor(expression, htmlAttributes).ToHtmlString().Trim();
        string pureCheckBox = checkBoxWithHidden.Substring(0, checkBoxWithHidden.IndexOf("<input", 1));
        return new MvcHtmlString(pureCheckBox);
    }
}


 <div class="col-md-6">
     <div class="form-group row">
         <label class="text-right col-md-3">وضعیت</label>

         <div class="col-md-9">

             @Html.CheckBoxSimpleFor(model => model.Status, new { @class = "form-control filled-in" })


         </div>
     </div>
 </div>

Open in new window

0
In .net environment on a server with .net framework 4.5.2 installed , web api's are hanging and resulting in time out when the web config is introduced with a extra attribute of targetfarmework as 4.5, this was done for utilising the async features. however the same piece of api's work fine if no targetframework is mentioned in the config. Appreciate you expert advise on the cause & remedy to it.

Rgds,
0
Hi,
To the prompt, after having pressed Password button below. I expect the password strength to be shown, exactly after having input two password (but before Submit button is pressed). What to adjust?
http://my-friend.co/UserMaintenance2/Default.aspx?userid=mc23&readonly=n
0
We have a GPS tracking app
There is one windows app on windows server 2016 which communicates with the gps devices on different ports and accepts the data

We have recent seen problems where the gps devices stop reporting, even though they are constantly sending data every 30 secs  (some are saying 6 hours ago)

When we restart the windows app, they start reporting again within 30 seconds

We have 2 devices working on port a certain port
However, when looking at netstat, its showing 62 connections, and they are all ESTABLISHED
This sounds like its the cause of the issue

C:\Windows\system32>netstat -a -n | find /c "3333"
62

Open in new window


 TCP    82.113.146.43:3333     41.80.64.186:50270     ESTABLISHED
  TCP    82.113.146.43:3333     105.48.38.41:49817     ESTABLISHED
  TCP    82.113.146.43:3333     105.50.155.210:51853   ESTABLISHED
  TCP    82.113.146.43:3333     105.51.186.160:54257   ESTABLISHED
  TCP    82.113.146.43:3333     105.51.233.133:59692   ESTABLISHED
  TCP    82.113.146.43:3333     105.54.2.101:57306     ESTABLISHED
  TCP    82.113.146.43:3333     105.57.244.173:52367   ESTABLISHED
  TCP    82.113.146.43:3333     105.57.249.109:50983   ESTABLISHED
  TCP    82.113.146.43:3333     105.58.227.38:53840    ESTABLISHED
  TCP    82.113.146.43:3333     105.59.87.117:64881    ESTABLISHED
  TCP    82.113.146.43:3333     105.59.254.162:55759   ESTABLISHED
  TCP    82.113.146.43:3333     105.61.81.156:60019    ESTABLISHED
  TCP    82.113.146.43:3333     

Open in new window

0
Hello Experts,
I am testing a newly developed windows service and need to see how it handles system exceptions (something like outofmemory, etc). Is it possible to simulate any such occurrences from outside (without modifying the underlying code)? Please suggest.
0
consider following XML -->

<?xml version="1.0" encoding="UTF-8"?>
<abc:Root
    xmlns:abc = "http://www.abc.com"
    xmlns:xyz = "http://www.xyz.com
    xmlns:xlink = "http://www.somelink.com"
    xmlns:xsi = "http://www.somelink.com/schema">

I have a class for the purpose of serialization/deserialization

[XmlRoot(Namespace="http://www.abc.com")]
public partial class Root{

}

How do i deserialize the above XML, so that I don't loose any of the additional namespaces?
with what I have, I ran a test

1. I deserialized the above XML , to create an object.
2. then i serialized the object in step 1, and looked at the XML.
3. The XMl generated is missing other namespace attribute in the root element . It only has the xmlns:abc attribute.

How do I make sure, i don't loose other namespace attribute when I deserialize?
0
HI guys,
I have asp.net application and have button which is implemented on the server side.

<asp:TextBox ID="txtObject" onfocus="this.select();" runat="server" AutoPostBack="True" CssClass="form-control"></asp:TextBox>

Open in new window


I would like to fire this textbox just when user click ENTER key = 13, for now I used the method onchange "txtObject_TextChanged" as it is the only option i have in asp.net.

The issue I have is if I change anything in the textbox it postback and I would like to postback just when I press enter in the textbox.

I also tried to setup the  AutoPostBack to false and It didn't worked for me as if you set it to false the enter key will not work as well.

please any suggestions.

Thank you.
0
Hi,
I need to the following code to custom function.Any idea appreciate
 if (TxtPostcode.Text == null && string.IsNullOrWhiteSpace(TxtPostcode.Text))
                    {
                        validate = 1;
                    }

                    if (TxtDestinationName.Text == null && string.IsNullOrWhiteSpace(TxtDestinationName.Text))
                    {
                        validate = 1;
                    }

                    if (TxtDestinationDescription.Text == null && string.IsNullOrWhiteSpace(TxtDestinationDescription.Text))
                    {
                        validate = 1;
                    }

Open in new window

0
Trying to populate my combobox.  I get an error on "ValueMember".  When I bypass that statement the combobox is filled with "System.Data.DataRow".
    Private _results As New List(Of DataRow)

    Dim SQL As String = String.Empty
    Dim sqlData As New SQLData

    Private Sub PopulateSuppliers()

        Me.cbSupplier.Items.Clear()
        Me.cbSupplier.DataSource = Nothing

        SetSupplierSQL()
        _results = sqlData.SelectStatement(SQL)

        Me.cbSupplier.DataSource = _results
        Me.cbSupplier.DisplayMember = "id"
        Me.cbSupplier.ValueMember = "name"

    End Sub

Open in new window


Any ideas?
0
Keep up with what's happening at Experts Exchange!
LVL 11
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

I need to pass 2 parameters to a controller in mvc 5, but am having problem setting the route. Here's what I have so far:
routes.MapRoute(
                name: "DispatchDetails",
                url: "Dispatches/Details/{id, modal}",
                defaults: new
                {
                    controller = "Dispatches",
                    action = "Details",
                    modal = UrlParameter.Optional
                }

            );

Open in new window


this results in a 500 error on the client.  The first param is required, the second is optional.  Any guidance appreciated.
0
Hi Experts,
I use Crystal Reports in my C#.Net Windows Service.
When I run my app, I get the error below:

ERROR
The type initializer for 'CrystalDecisions.Shared.SharedUtils' threw an exception.

Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies.
The system cannot find the file specified.



I do see CrystalDecisions.Shared.dll in my Windows bin folder.

How can I resolve this issue?

Thank you in advance,
mrotor
0
Hi Experts,
I need help checking for null values in my C#.Net program.

Here is a sample of my code, how would I check for null values in order to prevent my program from crashing?

SAMPLE CODE:
PatientLName = reject.PatientLName.ToString();

Open in new window


Thank you very much in advance,
mrotor
0
Hi
 Is there a single expression for following ( I can writ e a small routine for this . but What I am looking is a more compact one)

  I have a string which actually represents date ( Like - 31/08/2017 )
  I ned to convert it inot a different format but still as string  ( like 2017/08/31)

Cheers
0
Hi
i have a hibernate entity class
class task

private tasktemplate

class tasktemplate
private contactinfo

now when i fetch a task.
i do get the tasktemplate object.
but the contactinfo i get as null.

whereas if i fetch the tasktemplate directly then i do get the contactinfo object.
this contactinfo is a custom type which i am storing as json.
what could be the reason for this that when i am fetching it directly i get the proper data and when its inside as a reference a foreign key then i get it as null.
also this is only for custom types
there are other attributes in tasktemplate like normal string etc. they do get fetched.
i am using hibernate here

thanks
0
I am looking for how to properly move an ASP.NET website to a VS2013 website project or website application?

Thanks,
Andrew
0
I had this question after viewing Microsoft Management Console has stopped working.
0
Hello,

I've used Quartz.NET from nuget package and added Job & Scheduler code and called
JobScheduler.Start(); in "Application_Start".
So, JobScheduler.Start(); is calling by application. But "Execute" method is not triggering.

FYI, I am using application with IIS. Is there any IIS setting required?

Best Regards,
Mohit Sharma
0
I want to store a string list globally in VB.NET  winform application ( Similar to how an enumerated list is kept . But the value has to be string and not numeric)

C# example is also fine

Thanks
0
Prepare for your VMware VCP6-DCV exam.
LVL 1
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Hi, Im getting following error Messages

HTTP Error 500.21 - Internal Server Error
Handler "ExtensionlessUrlHandler-Integrated-4.0" has a bad module "ManagedPipelineHandler" in its module list

I have run following command  no results

c:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -I


%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i
0
Hi, I need to install C# Application the Network sharing place. Then all the users to access the EXE file.
without installing all the user's machine individually. How to do that.
Many Thanks
0
We have xml file that actually just look like HTML with input and select HTML for example, we have list of car maker, model and etc

We were able to parse xml on mvc project and it looks fine.

Now, we are trying to build admin portal to allow our manager to crud plus clone e.g. Car and model. But we have very short development time frame. I hope I can have some good ideas to start with or if you know any out of box solution and it will work as well
0
This is a two part question. I'm using VS 2015 Enterprise with .NET 4.7 Projects are VB.NET
1. How do I setup my CR inside my VB.NET project so that the data .XML file resides in a environmental variable location?
    When I set my Datasource Location inside my application project (Using ADO.NET) it asks for a specific .XML location.
    I can put in "C:\SomeFolderName\data.xml" & it works, but I'd rather not clutter up Users Machine with a folder that may get deleted or altered. So my thinking is to put the file into [APPDATA] folder, but the project looks for the file upon entry.
2. How do I include, or automate the Crystal Reports redistributable inside my setup project?
    I can put the CR_64bit.msi & CR_32bit.msi on the disk & have the User install the correct one first, but I'd rather not leave the install up to possible omission or wrong one.
Thank you,
Russ
0
I am working on a gps tracking  Windows application that uses Asychronous socket communication to talk to the tracking  device(s).

I'm having a problem where data from one unit is contaminating data with another unit
The IMEI in the unique identifier
However the IMEI only comes in on the handshake, after this, the IMEI isn't sent, so i store the IMEI and REMOTE ENDPOINT in an object, and use the REMOTE ENDPOINT (which is available on each subsequent message) to look up the IMEI number

The issue seems to be related to the app being multi threaded.
Here is the process:

So I basically create a listener socket:

tcp_listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
Bind to an endpoint
tcp_listener.Bind(new IPEndPoint(IPAddress.Parse(“41.215.42.55”), 10005));

Open in new window


Set up a callback to be notified of connection requests:

tcp_listener.BeginAccept(new AsyncCallback(OnConnectRequest), tcp_listener);

Open in new window


so upto this point, we are ready to accept connection requests from devices. When a device tries to connect, OnConnectRequest() event handler is fired
Socket client;

public void OnConnectRequest( IAsyncResult ar )
{
try
            {
                Socket listener = (Socket)ar.AsyncState;
                NewConnection(listener.EndAccept(ar));
                listener.BeginAccept(new AsyncCallback(OnConnectRequest), listener);
            }
            catch (SocketException e)
            {
                writeErrMsg(e.Message);
            }
}

Open in new window


To receive data asynchronously, it is necessary to setup an AsyncCallback to handle events triggered by the Socket such as new data and loss of connection. This is done using the following method


Open in new window

0
I have a very small c# form that allows users to copy / paste files into a specific folder.  I have disabled the ability to right-click/double click on files that are in that folder.  However, if the user clicks on a file and pressed [Enter], it will open the file.  I need to stop this from happening.

Is there a way that I can stop the Enter key from working on the entire form.

Thank you.
0

.NET Programming

132K

Solutions

38K

Contributors

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.