Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

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

I am needing to compare values in two lists which are different types. What I need to do is find out if the AttendeeID is in both lists. If it is in both lists then do nothing, however, if the AttendeeID is not in both lists then we need to add that information to another list. I was trying to use LINQ to do this, however, I'm not doing something correctly and I'm not sure as to where I'm wrong. Below is the code that I currently have.

If TypeOf e.Item Is GridDataInsertItem Then
        
            'Remove individuals from list if they exist already in the outcome memos table before binding the list.
            Dim newClients As RadDropDownList = CType(e.Item.FindControl("rdlClientNames"), RadDropDownList)
            Dim getAllClients As New IndividualsBase
            Dim indList As List(Of IndividualsBase) = getAllClients.SelectIndividuals(0,True,Nothing,0)

            Dim getIndividuals As New OutcomesMemos
            Dim indMemo As List(Of OutcomesMemos) = getIndividuals.SelectOutcomeMemos("Active")
            Dim totalInds As List(Of IndividualsBase)

            indMemo = indMemo.Where(Function(xMemos) Not indList.Contains(xMemos.AttendeeID)).ToList()

            If totalInds.Count = 0 Then
                Dim list As New RadDropDownList
                list.Items.Item(0).Text = "All Individuals Have Been Added"
            Else
                newClients.DataSource = totalInds
                newClients.DataTextField = "FullNameID"
                

Open in new window

0
Microsoft Certification Exam 74-409
LVL 1
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Hi

I have used ado.net to return a dataset
I now need to query the dataset with linq

i.e.

int event1Count = ds.where(eventId = 1);
int event2Count = ds.where(eventId = 2);

Open in new window


How can I achieve this ?
0
HTML front-end development has its own limitations as it may be good for static pages but not much capable for dynamic applications. This is where a framework like AngularJS Development fits in – by enhancing the capability of HTML by several notches. And the end result is extremely functional as we
0
Hello,
I am getting an interop error
Could not load file or assembly 'Microsoft.Office.Interop.PowerPoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce19429c' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'Microsoft.Office.Interop.PowerPoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9

Any suggestions?

Regards
0
hello everyone i create one app.config file store in appsettings multiple username and password ?how can i store ? i just see in appsettings key and value and mention also key=username and value=some-pcusername or but i didn't get anything.
                    foreach (var key in appSettings.AllKeys)
                    {
                       //here i want to code with help of storing username and passowrd in appsettings i want to get information of that system
                    }
thank you !
0
I have the below datamodel.  In MyForm.GetData it is only looping once even though there are 3 rows.  How do i get it to loop and get all the data.

public class DurationModel
{
	public string Duration { get; set; }

	public IEnumerable<List<DurationModel>> GetDurationItems()
	{
		List<DurationModel> durationItems = new List<DurationModel>();

		durationItems.Add(new DurationModel()
		{
			Duration = "1 Day"
		});

		durationItems.Add(new DurationModel()
		{
			Duration = "1 Week"
		});

		durationItems.Add(new DurationModel()
		{
			Duration = "1 Month"
		});

		yield return durationItems;
	}
}

public class MyForm
{
	private ObservableCollection<string> _durationItems = new ObservableCollection<string>();
	private IEnumerable<List<DurationModel>> _durationModel = new DurationModel().GetDurationItems();

	public MyForm()
	{
		GetData();
	}
	
	private void GetData()
	{
		foreach (var items  in _durationModel)
		{
			_durationItems.Add(items[0].Duration);
		}
	}	
}

Open in new window

0
Below is a mock up of some code.  I have a PopulateModels method.  It is dynamically populating the models.  How do you refactor to remove the code from MyForm?

public class PersonModel
{
	public int PersonID { get; set; }
	public string FristName { get; set; }
	public string LastName { get; set; }
	public datetime DOB { get; set; }
}

public class CourseModel
{
	public int PersonID { get; set; }
	public int InstructorID { get; set; }
	public string CourseName { get; set; }
	public datetime CourseDate { get; set; }
}

public class MyForm
{
	private List<PersonModel> _person = new List<PersonModel>();
	private List<CourseModel> _courses = new List<CourseModel>();

	public MyForm()
	{
		PopulateModels();
	}
	
	private PopulateModels()
	{
		int count = 0;
		DateTime addDays = new DateTime(2017, 06, 01);

		_person.Add(new PersonModel()
		{
			PersonIDID = 1,
			FirstName = "John",
			FirstName = "Doe",
			DOB = DateTime(1992, 03, 21);
		});

		for (int i = 0; i < 10; i++)
		{
			_courses.Add(new CourseModel()
			{
				PersonIDID = 1,
				InstructorID = count++,
				CourseName = GetCourse(count);
				CourseDate = addDays.Date.AddDays(days)
			});


			if (count == 5)
				count = 1;

			count++;
			days += 3;
		}	
	}
	
	//More Methods
}

Open in new window

0
I have an input panel with several textboxes and a DBGrid. This is connected to binding source to 2 joined tables (a parent - child one-to-many on a RID field in both tables) This was originally developed to view entered records, but now the client wants to be able to edit all the data in the joined tables, including the RID fields. The first concern is if the RID gets changed in the textbox, the rows have to have the RID column changed after the textbox edit. The RID field is hidden in the grid.

Secondly, they also want the ability to add new records in this form as well. At this point, upon an add new row, the value of the RID textbox needs to be inserted into the hidden RID field in the grid for the first row, and each consecutive row added (there can be any number of rows) So basically, OnAddNew in the grid needs to set Column RID.Value = TextBoxRID.value. Now to add a twist, lets say the user enters the new RID in the textbox, then enters several rows in the Grid, and goes back and changes the Textbox RID, there needs to be a routine that will update the RID column fields in the Grid when the textbox change has been completed. I don't want to check/change on every keystroke in the textbox, but maybe on a lostfocus?

Keep in mind that these fields (textbox & grid) are bound to a dataset via a BindingSource and aTableAdapter.

Any help would be appreciated.
0
Hello,
i have code :

    If NumberOFPictures <= 47 Then
                            Slidenumber = 2
                        ElseIf NumberOFPictures > 47 And NumberOFPictures <= 94 Then
                            Slidenumber = 3
                        ElseIf NumberOFPictures > 94 And NumberOFPictures <= 141 Then
                            Slidenumber = 4
                        ElseIf NumberOFPictures > 141 And NumberOFPictures <= 188 Then
                            Slidenumber = 5
                        ElseIf NumberOFPictures > 188 And NumberOFPictures <= 235 Then
                            Slidenumber = 6

                        End If

Open in new window

Is there any better way of writing this as the NumberOFPictures can be  even 2000

Cheers
0
Hello,
How can i add pictures placeholders on a powerpoint slide to appear next to each other and take a new  row when the row is full.
Also when the slide is full how it can autogenerate a new slide with placeholder for the pictures.
Currently I have a code for this, but its not very efficient as I am declaring the place of the placeholder.

Private Sub AddSlides()
        Dim intCurrSlide As Integer = ppPrsn.Slides.Count
        Dim currSlide As PowerPoint.Slide = ppPrsn.Slides(intCurrSlide)
        Dim objShape As PowerPoint.Shape = Nothing
        Dim pptLayout As Microsoft.Office.Interop.PowerPoint.CustomLayout
        pptLayout = ppPrsn.Slides(1).CustomLayout
        Dim length = l + 7
        Dim top = t + 10
        For i = 0 To 47

            pptLayout.Shapes.AddPlaceholder(PowerPoint.PpPlaceholderType.ppPlaceholderPicture, length, top, 75, 101)
            length = length + 78
            If i = 11 Then
                length = 10
                top = top + 130
            ElseIf i = 23 Then
                length = 10
                top = top + 130
            ElseIf i = 35 Then
                length = 10
                top = top + 130

            End If

        Next
        If ppPrsn.Slides.Count = 2 Then
            Dim slide As PowerPoint.Slide
            slide = ppPrsn.Slides.AddSlide(ppPrsn.Slides.Count, pptLayout)
        End If

        FlgSlideCreated = True

    End Sub

Open in new window

0
Free Tool: Site Down Detector
LVL 11
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Hello,
I have a template to export pictures on a powerpoint template. The vb.net code adds slides to the template depending on the number of pictures to be exported. How can i delete the blank slides.
This the code I am using
 Private Sub AddSlides()
        Dim intCurrSlide As Integer = ppPrsn.Slides.Count
        Dim currSlide As PowerPoint.Slide = ppPrsn.Slides(intCurrSlide)
        Dim objShape As PowerPoint.Shape = Nothing
        Dim pptLayout As Microsoft.Office.Interop.PowerPoint.CustomLayout
        pptLayout = ppPrsn.Slides(1).CustomLayout
        Dim length = l + 7
        Dim top = t + 10
        For i = 0 To 47

            pptLayout.Shapes.AddPlaceholder(PowerPoint.PpPlaceholderType.ppPlaceholderPicture, length, top, 75, 101)
            length = length + 78
            If i = 11 Then
                length = 10
                top = top + 130
            ElseIf i = 23 Then
                length = 10
                top = top + 130
            ElseIf i = 35 Then
                length = 10
                top = top + 130

            End If

        Next
        If ppPrsn.Slides.Count = 2 Then
            Dim slide As PowerPoint.Slide
            slide = ppPrsn.Slides.AddSlide(ppPrsn.Slides.Count, pptLayout)
        End If

        FlgSlideCreated = True

    End Sub

Open in new window


This code clears the placeholders :

  Private Sub ClearPictureBoxes(ByVal parent As PowerPoint.Presentation)
        Try
            If IsNothing(parent) = True Then
 

Open in new window

0
Hi,
I cannot show the message prompt properly, by the following. Why?

function showMsg0() {
    $.message({
        title: '信息',
        content: 'new或NEW是保护字,不可以选为名字简称!',
        buttons: {
            OK: {
                text: 'OK',
                btnClass: 'btn-green',
                keys: ['enter'],
                action: function () {
                    //$.alert('You clicked OK!');
                }
            },
        }
    });
    return false;
};
...
        protected void userabbr_post_change(object sender, EventArgs e)
        {
            if (tb_userabbr.Text.ToUpper() == "NEW")
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "showMsg0()", true);
                tb_userabbr.Text = "";
                return;
            }
        }

Open in new window

0
Hi

Are there any cloud accounting packages that have a .Net SDK  or API?

Thanks
0
Im trying to install Quickbooks 2010 on a Server 2012 for an accountant. I keep getting this error "The following feature couldn’t be installed:
.NET Framework 3.5 (includes .NET 2.0 and 3.0)

Windows Server roles and features cannot be automatically installed or uninstalled via the Windows Features Control Panel."


I goto Roles and Features and its already installed.
0
I have the below code that works.  I want it to validate two properties.
ViewChartCommand = new DelegateCommand(OnViewChartCommandExecute,(() => !(String.IsNullOrEmpty(_duration) ))).ObservesProperty(() => (SelectedDuration));

Open in new window

I tried to implement this but it looks like it is not working.
ViewChartCommand = new DelegateCommand(OnViewChartCommandExecute,(() => !(String.IsNullOrEmpty(_duration) || String.IsNullOrEmpty(_diagnostic)))).ObservesProperty(() => (SelectedDuration)).ObservesProperty(() => SelectedDiagnostic);

Open in new window

How do I check two properties?
0
I have a view...that build a few controls...and has two buttons..with JS events..that need to pass the values from the view in the  javascript function calls..

Please help.


Here is the section of the view where the controls are defined mostly.  My insert call for example here need to pass the contactid..which will be on a hiddenfield passed into the page from another page when this page is rendered.
The other values the user will select.  One is a dropdownlist populated from my controller/model.
The other is a dropdown with static values.
ANd finally the last column is just a decimal value input on screen.
There is also a client value passed fro mthe user selection of an autocomplete dropdown...not seen in this view.  Those values all need to go in my insert ...which is just an ajax call back to a controller method from javascript.

 <table id="new-row-template" style="display:none">
        <tbody>
            <tr>
                <td>
                    <label></label> 
                </td> 
                <td>
                   @Html.DropDownList("DropDownListID", new SelectList(ViewBag.DDLRoles, "Value", "Text"), "--- Please Choose an Item! ---")
                </td>
                <td>
                    <select id="selectdesignate" name="selectdesignate" class="form-control">
                        <option value="1"></option>
                        <option value="2">Primary</option>
                        <option 

Open in new window

0
Hello ,
Need help in this query, please see the excel sheet for the expected result.

;WITH Drivers
AS ( SELECT   J.DriverID ,
              MAX(J.CollectionDatetime) AS LastAllocStDate
     FROM     Table_JOB J
     GROUP BY J.DriverID ) ,
     A
AS ( SELECT j.ID ,
            j.ClientName ,
            j.DriverID ,
            CAST(j.CollectionDateTime AS DATE) AS AllocStDate ,
            j.Allocation ,
            CAST(j.AllocEndDate AS DATE) AS AllocEndDate
     FROM  Table_JOB j
            INNER JOIN Drivers d ON j.driverId = d.driverId
                                    AND j.CollectionDatetime = d.LastAllocStDate ) ,
     T
AS ( SELECT B.NAME ,
            A.Allocation ,
            A.AllocStDate ,
            A.AllocEndDate ,
            A.ClientName ,
            A.ID ,
            IIF(A.AllocStDate <= CAST(GETDATE() AS DATE) AND A.AllocEndDate >= CAST(GETDATE() AS DATE), 'Allocated', NULL) AS OnJob
     FROM   A
            INNER JOIN FieldResource B ON A.DriverID = B.ID ) ,
     Z
AS ( SELECT DISTINCT T.Name ,
            T.Allocation ,
            T.AllocStDate ,
            T.AllocEndDate ,
            IIF(T.OnJob IS NULL, NULL, T.ClientName) AS ClientName ,
            IIF(T.OnJob IS NULL, NULL, T.ID) AS ID ,
            IIF(T.OnJob IS NULL, 'YES', NULL) AS NotAllocated ,
            T.OnJob AS Allocated
     FROM   T )
,CTE1 AS
(
	SELECT   
			 Z.Name ,
			 Z.Allocation, 
			  Z.Allocated ,
			 Z.AllocStDate ,
			 Z.AllocEndDate ,
			 Z.ClientName ,

Open in new window

0
I am writing an app and I'm trying to perform a test.

    public class PatientDiagnostics
    {
        public int PersonID { get; set; }
        public int HeartRate { get; set; }
    }

Open in new window


I would like to dynamically change the heart rate.  Start off with HeartRate = 20.  Then increase and decrease it +/- 2, 3.
0
Develping a xamaring form.  Using Prism.  Have View and View Model.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms" 
             prism:ViewModelLocator.AutowireViewModel="True" 
             x:Class="MylApp.Views.ViewSelectionPage"
             Title="Selection">

  <StackLayout Padding="0,20,0,0">

      <!--x:Name="DurationPicker"-->
      <Picker 
              HorizontalOptions="FillAndExpand" 
              Title="Select Duration"  >
          <Picker.Items>
              <x:String>1 Day</x:String>
              <x:String>2 Days</x:String>
              <x:String>3 Days</x:String>
          </Picker.Items>
      </Picker>
  </StackLayout>

</ContentPage>

Open in new window


using System;
using System.Collections.ObjectModel;
using Prism.Commands;
using Prism.Mvvm;
using Prism.Navigation;
using Prism.Services;
using Xamarin.Forms;

namespace MylApp.ViewModels
{
    public class ViewSelectionPageViewModel : BindableBase, INavigationAware
    {
        private readonly INavigationService _navigationService;

        public ViewChartSelectionPageViewModel(INavigationService navigationService)
        {
            _navigationService = navigationService;
        }

        public void OnNavigatedFrom(NavigationParameters parameters)
        {

        }

        public void OnNavigatedTo(NavigationParameters parameters)
        {

        }

        public void OnNavigatingTo(NavigationParameters parameters)
        {

        }
    }
}

Open in new window


How can I programatically populate the Picker.  How do I get the value selected?
0
Transaction-level recovery for Oracle database
LVL 1
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

Can you give me example or idea on how to make this happen? Thank you.
0
I have two questions about "under the hood" processes executed by Webrequest and the getresponse method.

1) I have noticed while packet capturing that, when doing a webrequest with a payload, packets starting a TCP/IP connection are sent and received *before* the getresponse method?  I would have expected the payload to be cached and sent only when the getresponse was called?

2) I have a webrequest case that has me puzzled.  It is an HTTPS URI.  All proceeds as expected (443 TCP/IP connection made before getresponse called) until the getresponse is called.  When that happens, the process attempts to create a new TCP/IP connection to the server, this one being on port 80 (not HTTPS).  Since the request is not HTTPS, the server ignores it and the process times out with a "no response from server".

What would cause the getresponse method to spawn a new connection, and why would it send it via HTTP when the original connection was made via HTTPS?  The certificate for the server is valid, and I have tried turning off the check-certificate functionality.

Thanks for any insight on both questions.

Bryan Hunt
0
Dear Experts,
Please suggest how to set tab indexing for asp .net input controls in asp.net
0
I have a lawyer client who's having a problem with a 3rd party program, CaseMap, and .Net Framework 3.5.

His Windows 10 computer was a free upgrade from Windows 7, and is attached to a Server 2012 R2 domain.

When he tries to do a search in CaseMap he gets an error from CaseMap telling him there's a problem with .net 3.5.

I've done various uninstalls and reinstalls of .net 3.5 to no avail. CaseMap has also been uninstalled and reinstalled multiple times, including the last time allow it to reinstall .net 3.5. None of this has worked!

CaseMap tech support has told my client to reinstall Windows 10. This of course would be expensive because the free Windows 10 upgrade is no longer available, plus there'd be my time to basically setup a new computer.

I've attached CaseMap error message DotNet.jpg, and the detail, DotNet2.jpg.

BTW, I know nothing about CaseMap, so my client, a very computer knowledgeable guy, takes care of the CaseMap installations and talking to their tech support.

Am I certain it's not really a CaseMap problem? Of course not!

We've run out of ideas, and would appreciate any suggestions.

Thanks

Mark
DotNet1.JPG
DotNet2.JPG
0
So not sure if it related to Patch Tuesday or not, but after I updated my computer Powershell ISE stop working.
I have search the internet for fixes and tried them.
  1. MalwareBytes for Poweliks and nothing came up
  2. Installed PS 5.1
  3. Checked and confirmed that KB3163245 is installed, but this was well before I started to have this issue. I did uninstall it, but still having the same issue.

Any Ideas
0
Dear Experts,

I need to process attached excel and insert these records into oracle table. I have below code works for me. Moreover excel's cell(A1) is not readable. Using below code I am reading 1st 3 cells:

                Dim cmdExcel = New OleDbCommand("select * from [" & strWSheetName & "$]", connExcel)
                daExcel.SelectCommand = cmdExcel
                daExcel.Fill(ds, "CUSTOMER")
                dTable1 = ds.Tables(0)

                           strCUST_NAME = dTable1.Rows(0).Item(0).ToString()
                     strS_E_DATE   = dTable1.Rows(1).Item(0).ToString()
                     strDISC_DATE  = dTable1.Rows(2).Item(0).ToString()

Its skipping the R1 row and starting from R2. If I move R1-R3 to R2-R4 then it works fine and I get expected output. Moreover I need expected output without any modification.

Source Records format: Refer Attachment
R1 Customer: SYNTEL                  
R2 Period: 2016-12 - 2017-05                  
R3 Discount Date: 2017-05-31 00:00:00                  
R4                  
R5    PartyName      PartyBix      Ranking
R6       AIG                     Insurance      1232
R7       Humana             Helthcare      3242
R8       Athena             Helthcare      3434
R9       BOA             bank              3431

Expected records in Table

Customer      Period      DiscountDate      PartyName      PartyBix              Ranking
Syntel              2017-05      5/31/2017              AIG                      Insurance      1232
Syntel              2017-05      5/31/2017              Humana              Helthcare      3242
Syntel              2017-05      5/31/2017              Athena              Helthcare      3434
Syntel              2017-05      …
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.