[Solved] Must declare the scalar variable “@lblCmpUserName”

I got the solution, I made a mistake in my INSERT query. It should be like this. string query=”INSERT INTO Company_Info2 VALUES (@UserName,@Cmp_Name,@Comm_Country, @Commercial_RegNo,@Cmp_DocPath, @Cmp_EstablishDate,@Cmp_Address,@IsAddress)”; solved Must declare the scalar variable “@lblCmpUserName”

[Solved] Japenese character in a filename changes to garbage if I download file from IE 11

I found the solution, here it is, I used UrlEncode on the filename which helped me solve my problem. Response.AddHeader(“Content-Disposition”, String.Format(“attachment; filename={0}”, HttpUtility.UrlEncode(docFileDTO.FileName))); solved Japenese character in a filename changes to garbage if I download file from IE 11

[Solved] How to implement currency conversion

Please change you code with below code [WebMethod] public decimal ConvertGOOG(decimal amount, string fromCurrency, string toCurrency) { WebClient web = new WebClient(); string apiURL = String.Format(“http://finance.google.com/finance/converter?a={0}&from={1}&to={2}”, amount, fromCurrency.ToUpper(), toCurrency.ToUpper()); string response = web.DownloadString(apiURL); var split = response.Split((new string[] { “<span class=bld>” }), StringSplitOptions.None); var value = split[1].Split(‘ ‘)[0]; decimal rate = decimal.Parse(value, CultureInfo.InvariantCulture); return rate; … Read more

[Solved] Sql: Incorrect syntax near ‘(‘ [closed]

Missing space and closing ) protected void Page_Load(object sender, EventArgs e) { string dsn = “foo”; string sql = @”SELECT * FROM ( SELECT F.Project AS ‘Project Number’, F.Account AS ‘Account’, F.Pd AS Period, F.Incurred AS Totals, C.Project AS ‘Project Name’ FROM Ultron.Final F INNER JOIN Ultron.Custom C ON F.Project = C.Project WHERE F.Project LIKE … Read more

[Solved] Search SQL by date ASP.NET

You should parameterized your query. DateTime doesn’t have any format associated with it, Format is only useful for displaying purpose. OleDbCommand cmd = new OleDbCommand(“Select * From TEST WHERE MatchDate >= @matchDate”, conn); cmd.Parameters.AddWithValue(“@matchDate”, DateTime.Today); // Just date part comparision // Or use DateTime.Now depending on your requirement) OleDbDataAdapter da = new OleDbDataAdapter(cmd); da.Fill(ds); This … Read more

[Solved] How do I write a regular expression that matches strings with exactly one space between each word and no trailing or leading spaces [closed]

How do I write a regular expression that matches strings with exactly one space between each word and no trailing or leading spaces [closed] solved How do I write a regular expression that matches strings with exactly one space between each word and no trailing or leading spaces [closed]

[Solved] Streamreader Directory [closed]

When you run a web application, the current working directory of the process isn’t the directory containing your source code. You might want to look at HttpServerUtility.MapPath or HostingEnvironment.MapPath. Note that this doesn’t really have anything to do with StreamReader – for diagnostic purposes, you’d be better off with something like: FileInfo file = new … Read more

[Solved] ASP.NET Login, invalid password

EDIT Now that I look closer there are many things wrong with this code. Standard practice is to check for the username/password combination in one shot: mysql = “SELECT 1 FROM [User] WHERE UserName=? AND Password=?”; OleDbCommand CheckUser = new OleDbCommand(mysql, con); // Add OleDbParameters here with the correct type/length CheckUser.Parameters.Add(“@userName”, OleDbType.Char, 20).Value = tbUser.Text … Read more