[Solved] Get Substring – everything before and after certain characters [closed]

You could use regular expressions, e.g: class Program { static void Main(string[] args) { var input = ” SUCCESS Post Policy Success INVOICE No. :: WS1704003404 || Policy No :: 59203313 || App No. :: 123456724 “; var pattern = @”::\s*(\w+)\s*”; var matches = Regex.Matches(input, pattern); foreach (Match match in matches) Console.WriteLine(match.Groups[1].Value); } } 1 … Read more

[Solved] ASP.NET TextBox with Suggestions

You didn’t specify if this is in a web page (ASP.NET using c#) or a Windows form. For ASP.NET I like the Ajax Control Toolkit, and it has an AutoComplete control that you could use to do this. http://www.asp.net/ajax/ajaxcontroltoolkit/samples/autocomplete/autocomplete.aspx If you want it for a Windows Forms app, see here: http://csharpdotnetfreak.blogspot.com/2009/01/winforms-autocomplete-textbox-using-c.html 1 solved ASP.NET TextBox … Read more

[Solved] Incorrect syntax near ‘=’ … Error in .ashx file [closed]

Do something like this: if(imageid != null) { SqlCommand command = new SqlCommand(” select Image from ImageStore where ImageID=” + imageid, connection); SqlDataReader dr = command.ExecuteReader(); dr.Read(); context.Response.BinaryWrite((Byte[])dr[0]); } else { SqlCommand command = new SqlCommand(” select Image from ImageStore where ImageID=0″, connection); SqlDataReader dr = command.ExecuteReader(); dr.Read(); context.Response.BinaryWrite((Byte[])dr[0]); } 1 solved Incorrect syntax near … Read more

[Solved] How to upload (multiple) files to SharePoint Online using CSOM?

I tested the below code in my local environment; it works fine. <div> <asp:FileUpload ID=”upldGradeReport” runat=”server” /> <asp:FileUpload ID=”upldExpenseReceipt” runat=”server” /> <asp:Button ID=”btnSubmitForm” OnClick=”SubmitButton_Click” runat=”server” Text=”Submit” /> </div> protected void SubmitButton_Click(object sender, EventArgs e) { sendToSharePoint(); Response.BufferOutput = true; Response.Redirect(“Submission.aspx”); } protected void sendToSharePoint() { try { string siteUrl = “https://tenant.sharepoint.com/sites/lee”; ClientContext clientContext = new … Read more