.NET Programming

132K

Solutions

77

Articles & Videos

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 need to access the registry in my .NET program I am writing and need to know if I reference this registry entry:

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Jet\4.0\Engines\Text

it will not break if the code is running on a 32 bit system.
0
Forrester Webinar: xMatters Delivers 261% ROI
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

I have a SQL Server table with column FullName VARCHAR(300)

I have a .net import from file process that runs fine except...
Where there are accent characters
It substitutes a ? as it goes into SQL.
Exemple   'PIñERO RODRIGUEZ' goes in as 'PI?ERO RODRIGUEZ'

However..if I run a simple update...
Things update correctly in SQL and can be selected with no issues

UPDATE dbo.Individuals
SET LASTNAME = UPPER('PIñERO RODRIGUEZ')
WHERE IndividualID = 204140


Or I do something simple in SQL like...
INSERT INTO Individuals
VALUES ( UPPER('PIñERO RODRIGUEZ'))   - (Abbreviated code of course...)

Inserts fine

So...

Do I need to change my import Sub (VB.NET) ?

Possibly the "AddWithValue" should actually be this type of format???
oCom2.Parameters.Add(New SqlParameter("@" + header(k), SqlDbType.VarChar, 300)).Value = returnRecords.Rows(i).Item(k).ToString()

This is how its sendingthe insert right now
Dim returnRecords As DataTable = Session("sheetData")
Dim test As String = hdJsonData.Value
 Dim header As String() = test.Split(",")
Dim columnNames As String() = returnRecords.Columns.Cast(Of DataColumn)().[Select](Function(x) x.ColumnName).ToArray()

Using... blah...blah...blah...
oCom2.CommandText = "InsertImportContactStaging"
 oCom2.CommandType = CommandType.StoredProcedure
oCom2.Parameters.AddWithValue("@ImportID", GUID)
oCom2.Parameters.AddWithValue("@ImportRecordType", Session("ImportFileType").ToString() + "")

             …
0
Hi Experts,

This is my program. I am using some private variable to hold the values. Then I am using them through out the program. I want to know is it the right way to do or I should keep them in the session variable and use them. I am curious to know that when many people access the same web page are these variables going to create problem or change the values.  I am using ASP.net and VB.net.

Thanks in advance.


Partial Class EditCustomerOrder
    Inherits System.Web.UI.Page
    Private Shared Calling_Form As String
    Private Shared CustomerID As Integer
    Private Shared LocationID As Integer
    Private Shared MenuOrderDate As DateTime
   
    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        If Not IsPostBack Then
            Calling_Form = Request.QueryString("Calling_Form")
       
            If Session("EditCustOrder_Calling_Form") Is Nothing = False Then
                Calling_Form = Session("EditCustOrder_Calling_Form")
            Else
                Calling_Form = Request.QueryString("Calling_Form")
            End If

            If Session("EditCustOrder_MenuOrderDate") Is Nothing = False Then
                MenuOrderDate = Session("EditCustOrder_MenuOrderDate")
            Else
                MenuOrderDate = Request.QueryString("MenuDate")
            End If
0
I am using lotus notes to send email in .net application using c#. I am able to send mails from this application while i run this in my local host. But the thing is when host the application in local IIS server i am not able to send mails.
 I am getting the following error.
Notes error: Notes shared login failed with this ID file.
Please tell me why i am getting this error after hosting the application.
0
Can anyone recommend a .Net Kafka library?


thanks,

Rick
0
My C# application is showing ominous behaviour.

The application is working perfectly fine for a specific Installation. But it's giving me this exception in another..
- SqlDataAdapter.Fill - Timeout expired.  The timeout period elapsed Prior to executing the query or the Server is not responding.

I've been searching all day for a solution and cant find anything helpful.

The c# Code is

            DataTable dt = new DataTable(tableName);
            try
            {
                using (SqlDataAdapter da = new SqlDataAdapter(SqlQuery, conn))
                {
                    Console.Write(SqlQuery);
                    da.Fill(dt);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Foo String there is nothing good Happening {0}", ex.ToString()));
            }

Open in new window


The SQL is : SELECT * FROM FooTable WHERE ColumnA=0 and ColumnB='15'

Every Google post I've been looking at is about "increase your command timeout". Which makes me almost give up hope.

The same SQL in SSMS Returns only 1 row and I've seriously no idea what is going on.

I've attached a Debugger to the process and can definitely say the code is reaching the Console.Write as a breakpoint.
The exception is thrown at the fill method line.

I'm highly thankful for any responses.
0
Two different workstations, two exact versions one has the link in the tools menu one does not, both have the application installed.  Why would the menu item disappear?

Thanks in advance!
0
I have a database that contains quotes for pricing. I am trying to copy a quote from the quote table and it's related records into the same tables as a way to provide the user a starting point rather than creating a new one from scratch. I have 3 tables...a quote is made up of several assemblies from the assemblies table and each assembly can contain many assembly items from the assemblyItems table.

So here is how it should work. I provide the new quote number to the stored procedure. It will copy the quote from the quote table into the same quote table using the new quote number. Also copy any related Assemblies into the assemblies table and each assembly's item into the assemblyItems table.

I also need the new QuoteID as a return value into my .NET app.

Thank you,
Randy

example structure
Quote
	|
	|----Assembly
	|	|
	|	|---AssemblyItem
	|	|---AssemblyItem
	|	|---AssemblyItem
	|
	|----Assembly
	|	|
	|	|---AssemblyItem
	|	|---AssemblyItem
	|	|---AssemblyItem
	|
	|----Assembly
	|	|
	|	|---AssemblyItem
	|	|---AssemblyItem
	|	|---AssemblyItem

Open in new window

0
I'm new to Entity Framework and looking to move future development of an existing application in that direction.  Previously the development has been 'traditional' with VB, Winforms and SQL DataAdapters.  Looking forward, I'll be moving to C# with EF6 (or EF Core).  I'm currently working out how best to do this.  

To minimise impact on end users, I need the new forms I develop to work the same way as they always have.  In the past, for a data object neededing validation, I would handle the .validating event of the Control to which the data was bound and, if validation failed, display a messagebox to the user, set e.cancel=True and get them to try again.

That way, the validation code is in the Client Side  (the view).  In future I want it on the Object Model so that I can use the same validation for potential future development on other platforms (e.g web access).

I've read a lot about this and it doesn't seem to be the way validation works on EF.  Here's where I am.

I have a 'Schedule' data object in EF that has a field / property for Interval_Mins, which is an Integer value representing Minutes.  I want to ensure this value is between 1 and 59 (for example).

I know about the Range DataAnnotation but I want to do this in code in case I require some validation more complex that DataAnnotation allows (also I'm new to DataAnnotation so not clear on it's limitations - let me know if that's the better approach).

So, in my partial class for my 'Schedule' object I …
0
I have a ASP.NET application. I'm using TFS to check in my code.

In my project I revised a few files and then checked them in to tfs.

But after I checked my files in. I noticed the one file that I didn't check in was the Visual Studio .csproj file.

So when I get the latest. The files I checked in are phyiscally there but not included in the application directory.

Is there a way to fix this? So the checked in files are added to the app directory.
0
PeopleSoft Has Never Been Easier
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Hi Experts,

I am testing my project in multiple computers and found a serious problem.

In Machine 1
I log in as an Admin. Then In the page I have to select Customer, location and Room. Then I click OK to go to a different page. (Sesson Admin='Y')

Then in Machine 2, I log in as a user.  select Customer, location and Room. Then I click OK to go to a different page (Sesson Admin='N')

When I come back machine 1 , where I logged in as Admin='Y' before, it changes it to Admin='N'  and all the selection (Customer, location and Room) has changed to that of machine 2.

What should I do. Please help.

Thanks in advance.
0
Hi,

I have a .net application where I'm wanting to host files on a separate drive (D:/) on the same web server. I have that drive set up as a virtual directory in IIS, Problem is when I go to download the file, the browser thinks of course I am sending the user to that virtual directory, and the user is bounced to the login page with this querystring: /login.aspx?ReturnUrl=%2fattach%2fCustomer_Agreement_Test_125372.docx. When I was using Amazon S3, this wasn't the case - is that because the request was to a different server?

The virtual directory pointing to the D drive has a URL of https://[domain].com/attach/, and the dev site URL I'm testing on is https://[domain].com:4443

I can't figure out what's happening here - any ideas?

Thanks,
Steve
0
<asp:GridView ID="grdAdmin" runat="server" AutoGenerateColumns="false" GridLines="None"  CssClass="table table-condensed table-hover table-striped small" data-toggle="bootgrid">
                <Columns>
                    <asp:BoundField HeaderText="#" DataField="ID"  />
                    <asp:BoundField HeaderText="TableID" DataField="TableId" />
                    <asp:BoundField HeaderText="FieldName" DataField="FieldName" />
                    <asp:BoundField HeaderText="isKey" DataField="isKey" />
                    <asp:BoundField HeaderText="canEdit" DataField="canEdit" />
                    <asp:BoundField HeaderText="canFilter" DataField="canFilter" />
                    <asp:BoundField HeaderText="FilterTypeID" DataField="FilterTypeID" />
                    <asp:BoundField HeaderText="SortOrder" DataField="SortOrder" />
                    <asp:BoundField HeaderText="Active" DataField="Active" />
                    <asp:CommandField HeaderText="" />
                </Columns>
            </asp:GridView>


 private void grdAdmin_RowCreated(object sender, GridViewRowEventArgs e)
        {
           
            if (e.Row.RowType == DataControlRowType.Header)
            {
                e.Row.Cells[0].Attributes.Add("data-column-id", "ID");
                e.Row.Cells[0].Attributes.Add("data-identifier", "true");
                e.Row.Cells[0].Attributes.Add("data-type", "numeric");
                …
0
Hi how do i insert an image in a form that i send via email
ObjSendMail.HTMLBody ="Nombre:" +" " + Request.Form("fname") & Chr(10) & "<br>Email:" +" " + Request.Form("email") & Chr(10) & "<br>Consultorio:" +" " + Request.Form("consultorio") & Chr(10) & "<br>Comentarios:" +" " + Request.Form("message")

Open in new window


thats the text, i want to insert an image in the top of that

<img src="images/Oncdelbajiologo.png"

regards
0
Hi, All - I am a budding FileMaker developer, and I have a new client who wants a POS system The first challenge I need to solve is how do I get the cash drawer to open.

My research has shown I can get Troi Serial but I am hoping to open the drawer natively, or at least perhaps using 360 Scriptmaster plugins send a windows shell command.

The printers are Epson TM-T20, The operating system of the POS tills are Windows 10.

Any guidance is very appreciated.

Thanks!
0
I had this question after viewing VB .Net - web browser control.  Automate clicking on and manipulating popup windows after downloading .exe file.

Basically, I am trying to do almost the same thing but I don't want to wait for the "Choose File to Upload" window to load. Instead, I'd like to:

1) Wait till the window becomes available
2) Automatically hide the window and send it back once it becomes available by intercepting the opening of that window
3) Set the file location to the file upload window in the background
4) Once set, click the "Open" button (like how it is being done now)

Could someone please provide some code on this scenario as I really need to get this working.

Cheers.
0
Hello experts,

We have multiple app pools in our IIS (version 7) with a mixture of .Net Framework versions 2.0 and 4.0. We noticed that the app pools that are version 4.0 resets back to 2.0 after patching with reboot, thus cause us errors. Any ideas on how to fix this issue?

Thank you!
0
Hello,

Cannot break and debug stored procedure while debugging .NET application using Visual Studio 2017.
i followed the same steps as i would do in visual studio 2015 but no good .

Cheers
0
Hi

Is there any possibility to migrate RPA (Ui Path,Blue Prism,Open Span) tool code to Automation Anywhere.

Thanks in Advance.

Thanks
Prudvi
0
Why You Need a DevOps Toolchain
Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

to restrict multiple windows of my windows program ,if  the program is already open must show error that program in already running can anyone help with this
thanx
0
Hi,

I could use some help with a very mysterious error I am encountering. I am working with a windows application (.NET Framework 3.5, x86 platform, IDE = Visual Studio 2008, WPF frontend, MS Access backend, Jet OLEDB db connection) that, among other things, allows the user to generate plain text files and save them to a location of their choosing. The InvokeSaveDialog() function shown below is the piece that's giving me trouble.  

    
public class SaveFileDialogManager
    {
        public SaveFileDialogManager()
        {
            // CONSTRUCTOR
        }

        /// <summary>
        /// Prompts the user for the name of the file they intend to save.
        /// </summary>
        /// <param name="fileExt">File extension of file being saved</param>
        /// <param name="fileTypeDesc">Description of type of file being saved (ie. "SAS program")</param>
        /// <returns></returns>
        public static string InvokeSaveDialog(string fileExt, string fileTypeDesc)
        {
            // Create new SaveFileDialog object
            SaveFileDialog DialogSave = new SaveFileDialog();

            // Default file extension
            DialogSave.DefaultExt = fileExt;

            // Available file extensions
            DialogSave.Filter = fileTypeDesc + " (*." + fileExt + ")|*." + fileExt + "|All files (*.*)|*.*";
            // Adds a extension if the user does not
            DialogSave.AddExtension = true;

            // Restores the selected 

Open in new window

0
Hi, I need to make a backup of my vps which is installed with centOS 7, so I need to back up and copy all files to my local computer to make some tests on the localhost before upload the data to the server
0
Hello Experts,
I am trying to debug a Stored Procedure and I get the following error as soon as I Start Debugging.  Any idea what is going on?

Error Message:  Unable to start T-SQL debugging. Could not attach to sql server process on XXX.  The object exporter specified was not found.

Thank you in advance!
0
Hi Experts,

I have a date picker control.  I have three categories of dates.

1. Menu Available - If menu available for that date then change its color. Which I can do right now.

2. Customer Order available - If Customer order available then change its color to a different color(This web method has a CustID parameter).

3. If the date is a holiday, then disable it.

Thanks in advance.
0
I have a .net project with 2 layers: the Data layer (DAL) and the Business layer (BLL). I use Entity Framework - Database First in my DAL and I've implemented the Repository-Pattern in my BLL with the Get/GetById/Add/Update/Delete operations.

The reason that I use 2 layers and do not directly access the data layer is that must have business entities that can be manipulated as the data, but its may have some added logic that the data do not have.

for instance: in DAL I have 2 models (auto-generated by E.F.):
public partial class customer
{
    public int id { get; set; }
    public string firstname { get; set; }
    public string lastname { get; set; }

    public virtual ICollection<customers_addresses> customers_addresses { get; set; }
}

public partial class customers_addresses
{
    public int id { get; set; }
    public int customerId { get; set; }
    public string address1 { get; set; }
    public string address2 { get; set; }

    public virtual customer customer { get; set; }
}

Open in new window


In my BLL I have similar but not equal models (Check the differences in Camel Case and the Addresses property, and the pluralization of the name of the class customer_addresses)

public class Customer
{
    public int Id { get; set; }
    public string Firstname { get; set; }
    public string Lastname { get; set; }

    public virtual ICollection<CustomerAddress> Addresses { get; set; }
}

public class CustomerAddress
{
    public int id { get; set; }
    public int CustomerId { get; set; }
    public string Address1 { get; set; }
    public string Address2 { get; set; }

    public virtual Customer Customer { get; set; }
}

Open in new window


In my CustomerRepository I have the Get implementation:

/// <summary>
    /// Get All Customers
    /// </summary>
    /// <returns></returns>
    public IQueryable<Customer> Get()
    {
        var customers = _db.customers.Select(c => new Customer()
        {
            Id = c.id,
            Firstname = c.firstname,
            Lastname = c.lastname,
            Addresses = m.customers_addresses.Select(ca => new CustomerAddress()
            {
                Id = ca.id,
                CustomerId = ca.customerId,
                Address1 = ca.address1,
                Address2 = ca.address2
            })
        });

        return customers;
    }

Open in new window


These are my doubts and / or difficulties that I am having:

  • The Get operations in the repositories must be IQueryables and the Querys must be transferred to the Data entities (DAL) with their corresponding mapping (properties and navigation properties) in order to be able to filter them and select them as if they were the data
0

.NET Programming

132K

Solutions

77

Articles & Videos

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.