.NET Programming

134K

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

I'm working with Google maps, and need to generate the Position list from database. I have not work to much with these things, and struggle to create an array that I can use.

This is how the sample line looks:
 Dim positonTitlesAndIcons As String(,) = New String(2, 3) {{"58.468688", "7.515196", "Test1", "truck_red.png"}, {"60.182109", "10.324894", "Test2", "truck_red.png"}, {"69.902528", "22.898733", "Test3", "truck_red.png"}}

But I need to create some sort of array/params like this


My.array(0) = ""58.468688", "7.515196", "Test1", "truck_red.png""
My.array(1) = ""60.182109", "10.324894", "Test2", "truck_red.png""
My.array(2) = ""69.902528", "22.898733", "Test3", "truck_red.png""

Dim positonTitlesAndIcons As String(,) = MyArray()

I get errors like this: Value of type 'Object()' cannot be converted to 'String(*,*)
0
JavaScript Best Practices
LVL 19
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

Hi all, i am looking for an example of use of the .NET ObfuscationAttribute to Protect a deployed DLL from reverse enginering with tool like Reflector
0
--Updated--

I'm trying to connect .NET to a published webservice.  The way the appserver is configured, I need to generate a connect request, which returns a uuid, then generate the actual request to get / update information, then generate a logout request.

I can connect to the web service; the connect request is supposed to return a value of type xxwt1ID, what I can't figure out is how to get that value and pass it to the actual request to get information from the web service.

I've imported the WSDL as a Service Reference and was able to connect using the statement  cReq3.Connect_xxwt1.  That connection is supposed to return a value of type xxwt1ID, which I then pass when I'm making the actual call to the webservice with statement cReq3.xxwt1(cReq3.xxwt1ID, "abc", "def", out strTest.

I've attached a simple example WSDL - and a stub of code to show what I'm trying to do - any help or suggestions on how to write code to login, retrieve data, and logout would be GREATLY appreciated.

Thanks,

-Dan


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {


            ServiceReference1.xxwt1ObjClient cReq3 = new ServiceReference1.xxwt1ObjClient();
      

            cReq3.Connect_xxwt1("danp", "apass", "test_AS");
            /* cReq3 is supposed to return a UUID.  How do I get the UUID? */

   

Open in new window

0
In .Net the regex (?<=>[^<]*?)\bă works as expected (find words that start with ă and are not located within a tag).

But in JavaScript Chrome \b won't work with Unicode texts.

What would be the correct equivalent in JavaScript for the above .Net expression?

(I am referring to the latest versions of regex/regexp)
0
Hello,

I have got a vbscript which renames the file in a folder the requirement is to loop in a folder and all its subfolders to see the files and rename them.
It works great on a file level but, need to loop in the folders and subfolders as well.
Please find the vbscript attched.
Option Explicit

RenameFiles "C:\test"

Function CanRename(AFileName)

  On Error Resume Next

  Dim Dummy

  Err.Clear
  Dummy = Right(FileNameWithoutExtension(AFileName), 10)
  Dummy = DateSerial(Mid(Dummy, 7, 4), Mid(Dummy, 4, 2), Mid(Dummy, 1, 2))
  CanRename = (Err.Number = 0)
  Err.Clear

End Function

Function FileExtension(AFileName)

  Dim Count
  Dim Result

  Result = ""
  Count = InStrRev(AFileName, ".")
  If Count > 0 Then
    Result = Mid(AFileName, Count, 1024)
  End If

  FileExtension = Result

End Function

Function FileNameWithoutExtension(AFileName)

  Dim Count
  Dim Result

  Result = AFileName
  Count = InStrRev(AFileName, ".")
  If Count > 0 Then
    Result = Mid(AFileName, 1, Count - 1)
  End If

  FileNameWithoutExtension = Result

End Function

Function RenameFileName(AFileName)

  Dim DATE_DELIMITER
  DATE_DELIMITER = "-"

  Dim LITERAL_DELIMITER
  LITERAL_DELIMITER = "_"

  Dim FileName
  Dim DateText

  FileName = FileNameWithoutExtension(AFileName)
  DateText = Right(FileName, 10)
  RenameFileName = _
    Mid(DateText, 7, 4) & DATE_DELIMITER &  Mid(DateText, 4, 2) & DATE_DELIMITER &  Mid(DateText, 1, 2) & LITERAL_DELIMITER & _
    Left(FileName, 

Open in new window

0
Hello Experts.

I installed 32-bit Oracle12 ODAC and where can I find the Oracle.managedDataAccess dll which is 32-bit  and I checked under C:\App\client\MyUserName\product\12.2.0\client_1\odp.net\managed\x86 and I didn't find that dll and I found Oracle.managedDataAccess dll underC:\App\client\MyUserName\product\12.2.0\client_1\odp.net\managed\common. How can I know whether it's 32 or 64-bit.

Below is the issue I have and I followed the instructions installing 32-bit ODAC.
https://stackoverflow.com/questions/1067727/connecting-to-oracle-from-ssis-on-vista-64-bit


Thanks,
ASPDEV
0
I have a data grid that I reorder from time to time to reflect the relevant information a user needs to see.
I need to restore the table to the default column layouts and don't have the slightest idea of how to do it. I can sort but not reorder back to default.

What is the secret?

Many thanks
0
Hello Experts,
I have a Class A in Project A.  I have a Project B too.  Project B would like to use some methods from Class A.  How can I do that.

Note: I am using ASP.NET and C# in Visual Studio 2015

Thank you!
0
Hello Experts,

I have a issue connecting to Oracle Database using ODP.NET (Oracle managed driver) in my SSIS pkg in VS 2017 under script task. I was using connection manager(no .config file for database connection string) Oracle ODP.NET Managed driver and no issues connecting to database but when I call the connection manager inside the script task and once the OracleConnection object instantiated(Oracle.ManagedDataAccess.Client, I added the reference dll)  and run the application below is the runtime error I get, interestingly it works with no issues when using Microsoft Oracle Client(System.Data.OracleClient, I added the reference dll).


 
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()

Open in new window


Please suggest or hep what exactly I was doing wrong.

Thanks,
ASPDEV
0
Given the code bellow

using System;
using System.Text;				
using System.Text.RegularExpressions;

public class Program
{
	public static void Main()
	{
		string Sentance  =@"pest, irritant, nag, nuisance, Colloq pain, pain in the neck or Brit taboo arse or US taboo ass; Slang US nudge";
		string[] Colloq = new string[] { "Brit", "US", "Australian", "Canadian", "New Zealand" };
        string[] Labels = new string[] { "Colloq", "Slang", "Taboo", "Archaic", "Old-fashioned" };
		
		string[] Words = Sentance.Split(',');
		foreach (var word in Words)
		{
			if (word.Contains(Labels))
			{
				// everything upto the next ; is that Label 
				// I need to capture the Label , Colloq and word treat 'or' as separate word
			}
			else{
			AlternateWords alternateWords = new AlternateWords()
			{
				AlertnateWord = word.Trim()
			};
			thesauri.alternateWords.Add(alternateWords);
			}
		}

    }
	
}

Open in new window


I need
AlertnateWord pest
AlertnateWord irritant
AlertnateWord  nag
AlertnateWord   nuisance

AlertnateWord Colloq pain
AlertnateWord Colloq pain in the neck
AlertnateWord Colloq Brit taboo arse
AlertnateWord Colloq US taboo ass
AlertnateWord Slang US nudge

Open in new window


Sorry I don't know how else to explain this
0
Starting with Angular 5
LVL 19
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

Hello,

When trying to install a Windows application using Clickonce technology, I receive the following error message in detail section of failed installation:

"Deployment and application do not have matching security zones"

How do I fix this error?

Victor
0
Can one set the default page of a web site or application  without changing the web.config file for that site or application?

(Using Windows Server 2019)
0
I have two project in same solution, where I try to use a form from the other project in this project.

I have added Project1 as en reference in Project2 (Reference to the exe file - Correct? )

And then I try this in a mdicontainer form i Project2:

        Dim ReportFrm As New Project1.Form_report

        ReportFrm.Close()
        ReportFrm.MdiParent = Me
        ReportFrm.WindowState = FormWindowState.Maximized
        ReportFrm.Show()

Then I get this error when try "ReportFrm.Show()" : exception: can't access removed object

What to do ?
0
Hello,

When attempting to run my project, I receive the following error message for several Forms in my project. How do I solve this issue?

Error:

Couldn't process file Form4.resx due to its being in the Internet or Restricted zone or having the mark of the web on the file. Remove the mark of the web if you want to process these files.      AOP-VOL1

Thanks,

Victor
0
I'm having issues with a piece of software that relies on a connection to a specific SSID using a wireless USB NIC.

The software relies on data sent to the computer from a scanning tool that connects to the same local network as the computer, it's relatively rare but we have problems with windows autoconnect working with the adapters we provide to the clients.

I'm looking for a way to check if the connection is working, and if it is not, to connect the wireless adapter to the SSID when the software is started.
 I'm using VB.net and C#.

If there is any other info you need I'll be happy to provide it.
1
Hi Experts,
I'm getting following  error message.
But this will get after nearly 19000 records downloaded.
earlier it's 401-unauthorized.but after reconnect it's worked until 19,000 records.
after that following error generated any idea?
i'm using RestSharp

The remote server returned an error: (502) Bad Gateway


I have found kind of solution but i don't know how to use  use with  Restsharp
see someone put solution for this but not Restsharp

https://stackoverflow.com/questions/2159361/error-502-bad-gateway-when-sending-a-request-with-httpwebrequest-over-ssl

https://stackoverflow.com/questions/10205854/error-the-remote-server-returned-an-error-401-unauthorized

Any idea much appricicated. main problem this will take time to long time to download after one hour error generate.
0
Hi
I have a text file with words like "intimate°" intimateý & tête-à-tête There's probably others

Is there a way to work out its encoding?  I'm guessing extended ASCII  

I've been using code bellow or similar StreamReader / StreamWriter like I said this a pure guess  

string[] AllLines = File.ReadAllLines(FileName,Encoding.GetEncoding("iso-8859-1"));

Open in new window


It looks OK on a sample file

Is there a Difference between StreamReader & File.Read..??

I'm assuming once you read a file into a string with a particular encoding the string inherits that encoding & this maintained if used in a class.
0
Hello,

I have a two part Boolean based filter that I need to apply.  Seemingly I have run every combination except for one. The 'one' part is where I need help! I've included one version of what I've tried bellow to give the idea of what I need to do.

Email: a field from a bound table
POC_email: a field from a bound table
CompanySearch.is a text box that the user enter their needed terms (e.g. 'Edward')

The concept is that I would like to return all record where the field data includes the search term indicated in 'companysearch.text'

Sample non working code:
Master_ContactsBindingSource.Filter = "email like '" & CompanySearch.Text & "*'" Or "POC_email like '" & CompanySearch.Text & "*'"
0
Hi I need some help refining my regEx

I need to split the example the numbers eg ". 2 " however I also need  to split on "--n. 5 " and keep the "n."
Note: i'm first splitting on ". 1 " has the preceding Lexical doesn't have '--'

What I'm getting is every number, which I don't need!
I do need the Lexical If there is 1 And the sentance

using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;

public class Example
{
    public static void Main()
    {
        Regex SentanceSpit = new Regex(@"\.(\s+\d+\s+)|\.--([a-z]+\.)\s+\d+\s+");
        string Line = @"abandon v. 1 give up or over, yield, surrender, leave, cede, let go, deliver (up), turn over, relinquish: I can see no reason why we should abandon the house to thieves and vandals. 2 depart from, leave, desert, quit, go away from: The order was given to abandon ship. 3 desert, forsake, jilt, walk out on: He even abandoned his fianc,e. 4 give up, renounce; discontinue, forgo, drop, desist, abstain from: She abandoned cigarettes and whisky after the doctor's warning.--n. 5 recklessness, intemperance, wantonness, lack of restraint, unrestraint: He behaved with wild abandon after he received the inheritance.";
        // Output strings
		string Term;
		string Lexical; // not every example have diferant Lexical
        string[] WordsExample;
        string[] Words;
        string Example;
		string[] FirstSecond = Regex.Split(Line, @"\s1\s");
		if (FirstSecond.Length ==2)
		{
			string 

Open in new window

0
Amazon Web Services
LVL 19
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

I am new to aws cloud programming/services. I am starting out with aws beginner course. As a developer, I want to see if I can migrate and host my code/database to aws cloud. for example, I have an asp.net project . Does aws support .net platform ?
what is the best course/resource I can take a look at for this.
0
I am trying to create a .NET report  using Crystal Reports.

The 3 steps required  to create the report is as shown in the screen below

Crystal Report Generation Screen
The first step is to create the DataSource  as in the 2 steps below

STEP1  Defining the Report  Content

  private void CreateDataSet()
        {
            //Creates a new dataset, 2 datatables and adds data to them
            _dsData = new DataSet("Employee");

            byte[] arrBytes;
            System.IO.MemoryStream ms;

            using (DataTable dt = new DataTable("Employee"))
            {
                dt.Columns.Add("Staff_no", typeof(string));
                dt.Columns.Add("Surname", typeof(string));
                dt.Columns.Add("Firname", typeof(string));
                dt.Columns.Add("midinit", typeof(string));
                dt.Columns.Add("DepartmentID", typeof(string));
                dt.Columns.Add("Sex", typeof(string));
                dt.Columns.Add("GradeID", typeof(string));

                GlobalConfig.Connection.CreateEmployeeDataTable((DataTable)(dt));

                _dsData.Tables.Add(dt);


            }

            ////Creates a relation between the 2 DataTables
            //_dsData.Relations.Add("relCountryStates",
            //    _dsData.Tables["Countries"].Columns["ID"],
            //    _dsData.Tables["States"].Columns["IDParent"]);
        }

Open in new window


Using the debugger  Step1 above appears ok and I am able to go into the method below that actually
writes the dataset.

In STEP2 below the stored procedure  tested separately  works selecting 2 records from the database (see  records below)

Stored Procedure Execution extracting the 2 records  required
STEP2  Loading the DataSet


Open in new window

0
Hi Experts,
i'm getting following datetime output but how to ignore when sending to the
SQL server. becuase SQL server genearion error message

01/01/0001 00:00:00

Sql error :
SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
0
how to get csv file in a treeview.
I am using vb.net desktop.

regards
0
Hello Experts,
I have a GridView, where I want to add a DropDown column.  When the page is loaded, the drop down should be populated with its selected value.  Please let me know how to achieve it.
FYI, I am using ASP.NET and C#.  Please try to help.  Thank you in advance.

Thank you!
0
Hi Expert,
Can you help me to find out where i'm doing mistake or how to call this and also I used  newtonsoft

Following way i have tried to Deserialize Json. The results from REST services working fine
(candidateResults) i iwll get the data.

 var jcCandidate1 = JsonConvert.DeserializeObject<List<candidateDetails>>(candidateResults);

also i tried
 var jcCandidate1 = JsonConvert.DeserializeObject<List<candidateDetails>>(candidateResults);

Open in new window



all classes  created according to Json Results. (go to Edit special paste -> select Json)

namespace TestConsolApp
{
   
    public class candidateMain
    {
        public candidateDetails[] Property1 { get; set; }
    }

    public class candidateDetails
    {
        public string _id { get; set; }
        public DateTime creation_date { get; set; }
        public string email_address { get; set; }
        public string headline { get; set; }
        public string initial { get; set; }
        public string name { get; set; }
        public string origin { get; set; }
        public string phone_number { get; set; }
        public candidateResume resume { get; set; }
        public candidateSource source { get; set; }
        public candidateStage stage { get; set; }
        //public object[] tags { get; set; }
        public DateTime updated_date { get; set; }
    }

    public class candidateResume
    {
        public string url { get; set; }
    }

    public class candidateSource
    {
        public

Open in new window

0

.NET Programming

134K

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.