[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

.NET Programming

133K

Solutions

39K

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

Good morning, I have a Windows Form (vb.net) and I am dynamically creating multiple DateTimePicker controls. The number of controls depends on how many employees are currently registered in the database. So for each employee they get a start and end time control for their schedule. I have read multiple articles and solutions and I am simply stuck. I need 1 handler to fire anytime a timepicker value is changed. Once the value is changed, the textbox next to it will show the timespan in hours that will be added to the schedule...

Any help would be great
Dim DateTimePicker As New DateTimePicker
                DateTimePicker.Name = "Start" & counter
                DateTimePicker.Size = New Size(80, 25)
                DateTimePicker.Location = New Point(Combo2.Location.X + 135, Combo2.Location.Y)
                DateTimePicker.ShowUpDown = True
                DateTimePicker.Value = "1/1/2018 06:00 AM"
                DateTimePicker.Format = DateTimePickerFormat.Custom
                DateTimePicker.CustomFormat = "hh:mm tt"
                Me.Panel2.Controls.Add(DateTimePicker)

                Dim DateTimePick As New DateTimePicker
                DateTimePick.Name = "End" & counter
                DateTimePick.Size = New Size(80, 25)
                DateTimePick.Location = New Point(DateTimePicker.Location.X + 90, DateTimePicker.Location.Y)
                DateTimePick.ShowUpDown = True
                DateTimePick.Value = "1/1/2018 12:00 PM"
                

Open in new window

0
OWASP: Forgery and Phishing
LVL 12
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

I have created a nav/tab menu, as below.
when user navigates to a particular tab, I want to add a border to the selected/active tab item, to show user that this particular tab is selected or say user is in this particular tab.

or may be even make the text bold for the selected item.

is this possible with just css or do we have to use javascript?

<ul class="nav">
  <li><a href="">Home</a></li>
  <li><a href="">About Us</a></li>
  <li><a href="">Contact</a></li>
</ul>

css  ...

.nav{
    list-style:none;
    margin:0;
    padding:0;
    text-align:center;
}
.nav li{
    display:inline;
}
.nav a{
    display:inline-block;
}
0
Hi Expert,
Technical Documentation is writing before development/Project start or after completed the project?
0
I hope someone can help me with this. I've spent all day at work on this and now off hours at home and still can't figure this out.

I'll go step by step.

What I want to do
I have a loop and a list. I want to loop and hold the List in another List. I didn't use an Array but if Array is better, I can use an Array.

What happens
I see the correct values for the list. I add both Lists to the final list but then the final list loses what I added first.

This is what I see when I debug

 This is the code. I've removed the sections that are not relevant to this List. I've marked the Lists  code with //****

 List<List<LogicOperator>> myList = new List<List<LogicOperator>>(); //************* list of lists

  if (model.FilterFieldKeys != null && model.FilterFieldKeys.Count > 0)
    {
      for (var i = 0; i < model.FilterFieldKeys.Count(); i++)
				{
					bool showOperator = false;
					var filterId = model.FilterFieldKeys[i];
					var oper = model.FilterOperators[i];
					var filterField = model.Fields.Where(x => x.FieldId == filterId).Single();
					var filterItemDbType = filterField.DbType;

					var isBool = ReportField.IsBool(filterItemDbType);
					var isObject = ReportField.IsObject(filterItemDbType);
					//var isDate = ReportField.IsDate(filterItemDbType);
					var shouldDisableValue = !model.DoesLogicalOperatorAllowValue(oper);

					List<LogicOperator> listOfOperators = new List<LogicOperator>(); //************ 

Open in new window

0
Hi,

I am working on Asp.Net Application to develop business application. All screes/forms built as UserControl(.ascx) and set as embedded resource. I am using the LoadControl()
Method to open these controls using registered VirtualPathProvider. Every UserControl have two local resource files (.resx) for Arabic and English.
My problem: The UserControls Loaded successfully but without any text, there is no text on buttons and labels,...

I attached a small project MyControls.rar to produce my problem. the webusercontrol contain single button, I need to show the text on the button.

Thank you for all
0
I have an asp:FileUpload control in my aspx page.
to override the default style, I put the control inside a label and make the control hidden. also I add an image , so that when user clicks on it, they will be able to upload the file.
as the file upload is hidden, the default behavior is also hidden , that is

when a file is selected , the name of the file is displayed next to this control .
when no file is selected , the text  "no file chosen" is  displayed next to the control.

How can i display those messages , when I want to style the asp:fileupload?

aspx page -----------------------

<label  class="upload">
  <asp: FileUpload id="uploadfile" ... style="display:none" > 
  <img sre=".." > 
</label>

css  -->
.upload{
  background-color: gray;
}
0
Hello all I am getting below error while updating the boot image.

  Error: Update boot image:
• Microsoft Windows PE (x86)

  Error: Update actions:
• Add ConfigMgr binaries using Production Client version 5.00.8692.1008
• Add custom background
• Set scratch space
• Enable Windows PE command line support

  Error: Failed to import the following drivers:

Optional components:
• Microsoft .NET (WinPE-NetFx)
• Windows PowerShell (WinPE-PowerShell)
• Scripting (WinPE-Scripting)
• Startup (WinPE-SecureStartup)
• Network (WinPE-WDS-Tools)
• Scripting (WinPE-WMI)

  Error: The wizard detected the following problems when updating the boot image.
• The SMS Provider reported an error.: ConfigMgr Error Object:
instance of SMS_ExtendedStatus
{
• Description = "Failed to inject OSD binaries into mounted WIM file (often happens if unsigned drivers are inserted into x64 boot image)";
• ErrorCode = 2152205056;
• File = "..\\sspbootimagepackage.cpp";
• Line = 5198;
• ObjectInfo = "CSspBootImagePackage::PreRefreshPkgSrcHook";
• Operation = "ExecMethod";
• ParameterInfo = "SMS_BootImagePackage.PackageID=\"ACM0076A\"";
• ProviderName = "WinMgmt";
• StatusCode = 2147749889;
};

any suggestions?
0
Hello,

We have a .Net application currently being hosted on win 2003 servers. As a migration activity we are planning to move/upgrade the application
to win 2012 servers. the Existing legacy application has COM+ Components since we are moving to new framework we are trying to find appropriate way
how we can handle this COM+ Components to new .NET framework and win OS.

QQ: Can we convert the COM+ to Active X and then deploy on the new env. Will this work and if yes . then can somebody share with me
the details as how to do this migration activity.
0
does any one have sample code or info how to call doc sign sdk
and select one of the templates that resided in doc sign portal?
0
ciao a tutti, volevo sapere in che modo era possibile esportare dei dati da una tabella di un db su sql server in excel tramite framework .net su vb.net
Fino ad oggi uso questa procedura ma per tabelle con molti dati il procedimento impiega troppo tempo. Importo la tabella su un datatable o un datagridview per visualizzarla al front end, una volta caricata con una funzione che si basa sulla classe interop excel vado a ciclare tutte le righe della tabella e le scrivevo su un file excel.
Mi sono accorto che per tabelle molto grandi l'export dura troppo tempo, allora spesso ricorro all'importazione direttamente da excel sulla scheda dati/nuova query/da database/da database sql server. la scheda mi richiede il server, il database e la query e con pochissimo tempo con il net framework si caricano tabelle con molti dati, già convertite anche per ogni formato cella. La mia domanda è se la stessa procedura può essere richiamata da vb.net, quindi con una funzione che una volta passati i parametri di server,db,query scriva velocemente su un file excel (.xlsx)
0
Exploring ASP.NET Core: Fundamentals
LVL 12
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

Hi i am having below issue when trying to call a stored proc from web Api , below is my code

Model:

 public class SF_Oculus_ListingsLast4Days_Vw
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public Int64? OculusListingsID { get; set; }

        public int? MLSID { get; set; }

        [StringLength(255)]
        public String MLSName { get; set; }

        [StringLength(100)]
        public String MLSAgentID { get; set; }

        [StringLength(100)]
        public String MLSOfficeID { get; set; }


Controller :

[ODataRoutePrefix("SF_Oculus_ListingsLast4Days_Vw")]
    public class SF_Oculus_ListingsLast4Days_VwController : ODataController
    {
        readonly OrdersModel _db = new OrdersModel();

        Action<OrdersModel> SetTimeOut = (OrdersModel _db) =>
        {
            if (_db != null)
                _db.Database.CommandTimeout = Constants.Constants.SqlTimeOut;
        };

        [ODataRoute]
        [EnableQuery(PageSize = 20, AllowedQueryOptions = AllowedQueryOptions.All)]
        public IHttpActionResult Get([FromODataUri] string SF_OwnerID)
        {
            SetTimeOut(_db);
            return Ok(_db.SF_Oculus_ListingsLast4Days_Vw(SF_OwnerID).AsQueryable());
        }

        //[ODataRoute("({key})")]
        [EnableQuery(PageSize = 20, AllowedQueryOptions = AllowedQueryOptions.All)]
        public IHttpActionResult Get([FromODataUri] int key, [FromODataUri] string …
0
I'm developing a web application to to fetch data from 'https://api.ebay.com/sell/analytics/v1/traffic_report'

I've a ebay developer account with ClientId: MyClientId ClientSecret: MyClientSecret AppId: MyAppId

To achive this, I need a OAuth token

To get OAuth Token I do the following steps.

I browse the url bellow

https://signin.ebay.com/authorize?client_id=MyClientId&redirect_uri=RuName&response_type=code&state=analytics&scope=https%3A%2F%2Fapi.ebay.com%2Foauth%2Fapi_scope%2Fsell.analytics.readonly

It goes to

https://signin.ebay.com/ws/eBayISAPI.dll?VAppJanessa&reqinput=reqinput - auto generate

after sign in it redirects to 'Grant application access to MySiteDisplayName' page.

After I Agree it redirects to 'https://my_site.com/?state=analytics&code=code' I've preapared a post request after collecting the code

I've executed the post request using POSTMAN like bellow

Post URL: 'https://api.ebay.com/identity/v1/oauth2/token'

Headers:

cache-control: no-cache

Content-Type: application/x-www-form-urlencoded

Authorization: Basic Base64 value of 'MyClientId:MyClientSecret'

Body:

grant_type: authorization_code

redirect_uri: RuName

code: code returned from previous request

After post request I've got the result

{ "error": "invalid_grant", "error_description": "the provided authorization grant code is invalid or was issued to another client" }

Please tell me what is missing or wrong.
0
Hello Folks,

I've a product which comprised with 50 modules along with 50 separate projects.
I would like to implement CI/CD (Continuous Integration/ Continuous Delivery) using VSTS (now Azure DevOps).

The concern is,
1. In 50 projects, each project comprises with own web.config along with multiple connection strings, report server url, other app settings' keys and other secret keys too (like google map key etc.).
2. So, what will be the best way to manage all configurations information to different environments like Dev, Test, Stage/UAT & Production?
3. Either use, web config transformation, Azure Wallet, Variable. Could you suggest best way?
4. OR I've other alternate to maintain all configuration for different environment store in database like "master" database (not SQL Server default database) and create a common project for all 50 projects to retrieve  information based on parameters.

Looking for your comments & feedback.

Best Regards
0
I'm getting the following error from above. This is happening when I'm trying to send an external email to my own environment. The only issue I have looked all over online and I have set my parameters correctly as bellow.

 MyServer.UseDefaultCredentials = false;
 port is 587.
 network host="smtp.gmail.com
 enableSsl="true"

The error is ocurring in my following catch statement. Not sure what i'm missing or how could I write this catch statement more effectively.
    catch (Exception ex)
            {
                System.Diagnostics.Debug.Print(ex.Message);

                myReturn = 0;
                throw;   // this is where the error is occurring...

            }
            finally
            {
                MyMessage.Dispose();
                MyServer.Dispose();
            }


public static int SendEmail(company.Models.Email passEmail, string fromEmail)
        {
            int myReturn = 0;

            // Get SMTP properties for specific employee
            SmtpSettings mySmtpSettings = ServiceAssistantService.SmtpSettingsService.GetSmtpSettings(passEmail.Employee.ID);
            if ((mySmtpSettings == null || string.IsNullOrWhiteSpace(mySmtpSettings.UserID) || string.IsNullOrWhiteSpace(mySmtpSettings.Password) || string.IsNullOrWhiteSpace(mySmtpSettings.Server) || mySmtpSettings.Port == 0)
                && passEmail.EmailSettings != null)
                mySmtpSettings = passEmail.EmailSettings;

            

Open in new window

0
Hello,
Any suggestion on how I can use Adobe in my vb.net app  to generate PDF from system.bytes(memory Stream).

Thanks
0
We have to remediate a number of open shares on our Windows network.  There are a significant number and I would like to automate the procedure as much as I can using VB.NET.

Without wishing to delve into the business background, the tasks I hope to automate are the creation of a group object in AD, adding users to the group, the removal the Everyone group permission from each share, and then adding a new group permission to the share.  So, the steps are:

1. Audit the access to the share and see which users and groups are accessing the share and the sub-folders (this task is done using Varonis)
2. Create a list of users that have implied access to the share via the Everyone group (this task is done using VB.NET examining the CSV reports from Varonis)
3. Create a group and add the user from step 2 (this task is done using VB.NET)
4. Grant access to the share for the group created in step 3 - to do
5. Remove the Everyone group from the share - to do

I have written the code for steps 1, 2 and 3, the problem I have is how to figure out how to connect to each identified share, remove the Everyone permission and add my new group and the required permission - I don't know how to do it.  This task is compounded by the fact the the shares are on NetApp filers too!

Can anyone help me with VB.NET examples of how to access a share on a server, remove the Everyone permission and add a new permission for my newly created group please?

Thank you.
0
Hi,

We have a website with a password protected section where our customers can access their own important and confidential documents. However, we are concerned that credentials might be provided intentionally from one user to another who belongs to a company that is not our customer in order to spy sensitive data. I have seen that some websites detect a suspicious behavior when validating credentials based on, form example, device type, browser, and other data. Our website was developed with .NET ASP.NET technology and I have found a tool called DeviceDetector.NET that is supposed to perform the detection I need.

Is this a good choice/approach or is there a better way to achieve the goal of detecting suspicious behavior access?

Respectfully,
Jorge Maldonado
0
Hi,
How to create multiple PDF pages saved as one PDF file by PDFsharp or MergeDOC.

I have an working code creating only 1 page but not multi page.
Any suggestions are appreciated.

 Dim dtSQLImage As New DataTable
        Dim imagedt
        Dim imageData() As Byte

        Dim unicode = PdfFontEncoding.Unicode
        Dim embedding = PdfFontEncoding.Automatic

        Dim clsFrmain As New ClsFrmMainLoad

        dtSQLImage = DgFinanceImg.DataSource
        Dim pdfRenderer As PdfDocumentRenderer = New PdfDocumentRenderer(unicode, embedding)
        For j = 0 To dtSQLImage.Rows.Count - 1
            If j = DirectCast(sender, Telerik.WinControls.UI.RadGridView).CurrentRow.Index Then
                imageData = (dtSQLImage.Rows(j)(0))

                For i = 0 To 2

                    imageFilename = MigraDocFilenameFromByteArray(imageData)
                    document = New MigraDoc.DocumentObjectModel.Document
                    Dim pageSetup As MigraDoc.DocumentObjectModel.PageSetup = document.DefaultPageSetup.Clone
                    ' set orientation
                    pageSetup.Orientation = MigraDoc.DocumentObjectModel.Orientation.Landscape
                    Dim section As MigraDoc.DocumentObjectModel.Section = document.AddSection

                    Dim image = section.AddImage(imageFilename)

                    '  Image.Top = ShapePosition.Top
                    ' Image.Left = ShapePosition.Left
                    ' Image.WrapFormat.Style = 

Open in new window

0
I have a .Net windows app.  It creates a Crystal Report in word.  It pulls data from a datasource and displays it in the report.  Sometimes the field is null and a textbox isn't created in the word document.  Is there a way to create the textbox even if the field is null?

Thanks
0
PMI ACP® Project Management
LVL 12
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

I am very new on using json and I want to have very simple code in c# to request docsign signature with json format.

can you show me ? thanks

I have most of the set up like api key and etc already

thanks
0
How do I get IMEI or MEID of a visiting device to a website or from a access point they are connected to in ASP.NET (C#)???
0
how to use Excel sheet to upload to lead entity?
how to remove prefix when the custom field is created?
how to connect to the Ms SQL DB?
what is alternative of adx?
how to view the relationship of selcted entities on dynamics 365?
0
json string have parent and child and child has sub child(grand child). Here wanted to remove grand child. child name and grand child name is same so if i remove based on the name it will remove child and grand child.But I wanted to remove only GrandChild property. I have converted json string to JObject here my code snippet: i know this is wrong it deletes both child and grand child because names are same. Please find attached my Json object structure and json string. I am using C#.net. Please let me know if you need any information.

JObject jObject = JObject.Parse(jsonString);
jObject.Descendants()
.OfType<jproperty>()
.Where(attr => attr.Name.Contains("NameofChild"))
.ToList()
.ForEach(attr => attr.Remove());
json-string.txt
jsonStructure.jpg
0
hi,

i have script working.
When it runs it check for files and send email alert if not files and also if has files.
Currently it sending the email alerts text format.
Request experts help, want to send email with htm format.
and for errors it should bold the text and color RED.
can help...


#Requires -version 3.0
$WarningPreference="Continue"
function Send-Mail
{
  param (
    [string] $Email_Subject,
    [string] $Email_Body,
    [string] $Email_Attachment
  )
  Send-MailMessage -SmtpServer 'mailserver.com' `
  -Body $Email_Body `
  -From 'donotreply@mail.com' `
  -To 'admin@mail.com' `
  -Subject $Email_Subject `
  -Attachments $Email_Attachment
}
function Send-Error
{
  Write-Host "Sending Error Alert @ $emaildate"
  $subject = "ACTION REQUIRED : Error Alert @ $emaildate"
  $logcontents = get-content $Logfile | Out-String
  $Body = "Dear All,`n`nThis email sent by system for errors highlighted below."  + $logcontents + "`n Regards,`n Job Process"
  Send-Mail -Email_Subject $subject -Email_Body $Body -Email_Attachment $Logfile }
function send-status
{
  Write-Host "Sending Success Alert @ $emaildate"
  $subject = "INFO : Success Alert @ $emaildate"
  $logcontents = get-content $Logfile | Out-String
  $Body = "Dear All,`n`nThis email sent by system for your information"  + $logcontents + "`n Regards,`n Job Process"
  Send-Mail -Email_Subject $subject -Email_Body $Body -Email_Attachment $Logfile }

  #check if source files exists
0
I built a wpf application for a screen resolution of 1920*1080 ...
however the user will sometimes use a resolution 3810*2160.
How to i make my application so it keeps its aspect ratio in a way that if in a screen resolution of 1920*1080  occupies 80% of screen then in a screen resolution of 3840*2160 it also occupies 80% of screen.
I will be looking into font sizes and all that stuff too... but at least for now I need that the grids, windows and controls all resize accordingly.

Regards.
0

.NET Programming

133K

Solutions

39K

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.