Categories
MySQL

Connecting to MySQL :: MySQL Query Browser :: MySQL error number 1130

Problem: Couldn’t connect to MySQL on TGIIS from TGSQL Solution: Try this command (after logging into mysql with root) GRANT ALL PRIVILEGES ON *.* TO ‘myaccount’@’%’ IDENTIFIED BY ‘some_pass’ WITH GRANT OPTION; where myaccount is any new account you want to create. Note the hostname is ‘%’ which gives blanket permission to allow logging in […]

Categories
ASP.NET

App_GlobalResources maps to a directory outside this application, which is not supported.

Problem I’ve created a very simple ASP.NET 2.0 application. I can run this with no problems using the Built-in Web Server. However, if I publish it and try running the application by typing http://localhost/talentdata/default.aspx directly in the browser window, I get the following error: Server Error in ‘/talentdata’ Application. The path ‘/talentdata/App_GlobalResources’ maps to a […]

Categories
SQL Server

Convert Julian Dates in SQL SERVER

SQL SERVER JULIAN TO DATE (WHEN DOWNLOADING JULIAN DATE) date field has to be nvarchar or varchar or character. declare @DateP char(10) select @datep=107277 — ALSO OK FOR 99 YEARS select dateadd(dd,@datep-(@datep/1000)*1000-1, convert(datetime,’01/01/’+ right(convert(varchar,@datep/1000),2))) as Date_ENT

Categories
SQL

sp_change_users_login (Transact-SQL)

Syntax sp_change_users_login [@Action =] ‘action’ [,[@UserNamePattern =] ‘user’] [,[@LoginName =] ‘login’] Arguments [@Action =] ‘action’ Describes the action to be performed by the procedure. action is varchar(10), and can be one of these values. Auto_Fix Links user entries in the sysusers table in the current database to logins of the same name in syslogins. It […]

Categories
PHP

PHP – Turning Off Error Reporting

Add the following to your PHP code: error_reporting(5); This will close all error reportings.

Categories
ASP.NET C#

Access Selected GridViewRow in GridView

GridViewRow selectedRow = (GridViewRow)(((Control)e.CommandSource).NamingContainer);

Categories
ASP.NET

Gridview – Getting the RowIndex

The following syntax sets the rowindex equal to the specific row number: int rowindex = ((GridViewRow)((Control)e.CommandSource).Parent.Parent).RowIndex;

Categories
ASP.NET

How to access the EmptyDataTemplate controls from OnRowCommand in GridView

For example – inserting value in the empty gridview: protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == “Insert”) { TextBox txt = (((Control)e.CommandSource).NamingContainer).FindControl(“txtTest”) as TextBox; //do insert action } } Another way to do this is by getting EmptyDataTemplate table and its controls: if (e.CommandName == “Insert”) { Table table = (Table)GridView1.Controls[0]; TextBox […]

Categories
SQL

Inner Join On Two SQL Databases

SELECT t1.columnName, t2.columnName FROM databaseName.user.table AS t1 INNER JOIN databaseName.user.table AS t2 ON t1.id = t2.id

Categories
SQL

SQL SERVER – Insert Multiple Records Using One Insert Statement – Use of UNION ALL

INSERT INTO MyTable (FirstCol, SecondCol) SELECT ‘First’, 1 UNION ALL SELECT ‘Second’, 2 UNION ALL SELECT ‘Third’, 3