Fix problem of Image preview is disable or not showing thumbnails

Some to we facing problem of window disable image preview or thumbnails like bellow highlight.

 

1

 

Here is the solution

  1. Click on View Menu.
  2. Click or tap on Options and select Change folder and Search options.
  3. Click on View and uncheck Always show icons, Never thumbnails.

1

 

1

 

 

 

Advertisements

MySql Connectivity with C#

Step1 : Add MySql ADO namespace :

https://www.nuget.org/packages/MySql.Data/7.0.7-m61

 

Step 2: Create Controller Class

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using MySql.Data.MySqlClient;

using System.Data;

/// <summary>

/// Summary description for MySqlController

/// </summary>

public class MySqlController

{

string ServerName = “localhost”;

string DataBaseName = “testdb”;

string UserID = “root”;

string Password = “”;

string connectionString;

MySqlConnection connection;

 

 

public MySqlController()

{

 

connectionString = “SERVER=” + ServerName + “;” + “DATABASE=” + DataBaseName + “;” + “UID=” + UserID + “;” + “PASSWORD=” + Password + “;”;

connection = new MySqlConnection(connectionString);

}

 

public int InsertData(string Query)

{

try

{

connection.Open();

MySqlCommand cmd = new MySqlCommand(Query, connection);

//Execute command

int i = cmd.ExecuteNonQuery();

connection.Close();

return i;

}

catch (Exception Ex) { throw Ex; }

}

 

public DataTable GetData(string Query)

{

try

{

MySqlDataAdapter da = new MySqlDataAdapter(Query, connection);

DataTable dt = new DataTable();

da.Fill(dt);

return dt;

}

catch (Exception Ex) { throw Ex; }

}

 

}

 

 

Default.aspx

<%@ Page Language=”C#” AutoEventWireup=”true” CodeFile=”Default.aspx.cs” Inherits=”_Default” %>

<!DOCTYPE html>

<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head runat=”server”>
<title></title>
</head>
<body>
<form id=”form1″ runat=”server”>

Name :

<br />

</form>
</body>
</html>

 

Default.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

 

public partial class _Default : System.Web.UI.Page
{

 

protected void Page_Load(object sender, EventArgs e)
{
lbl_message.Text = “”;
if (!IsPostBack) {
BindGrid();
}
}
void BindGrid() {
MySqlController objMSC = new MySqlController();
string Query = “select * from Info”;
var Data = objMSC.GetData(Query);
grid.DataSource = Data;
grid.DataBind();
}
public int InsertData(string Name)
{
MySqlController objMSC = new MySqlController();
string Query = “insert into Info (name) values (‘” + Name + “‘)”;
int R = objMSC.InsertData(Query);
return R;

}

protected void btn_Save_Click(object sender, EventArgs e)
{
try
{
string Name = txt_Name.Text.Trim();
int R = InsertData(Name);
if (R > 0)
{
lbl_message.Text = “Data Inserted”;
lbl_message.ForeColor = System.Drawing.Color.Green;
BindGrid();
}
else
{

lbl_message.Text = “Error While inserting data”;
lbl_message.ForeColor = System.Drawing.Color.Red;
}
}
catch {
lbl_message.Text = “Error While inserting data”;
lbl_message.ForeColor = System.Drawing.Color.Red;

}

}
}

 

Find PDF Tutorial File
https://programtuts.files.wordpress.com/2017/06/mysql-connectivity-with-c.pdf
or
MySql Connectivity with C

Jquery : Add Filter in first row of DataTable two row header.

Friends, whenever we use Jquery DataTable with custom filter option,but major problem occur when we have multiple row header so we need to put filter input on first row of thead so here the solution.

<table id=”tbl_Id” width=”100%”>
<thead>
<tr class=”filter”>
<th></th>
<th>Size</th>
<th>Price</th>
</tr>
<tr >
th>Product Name</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>T-shirt</td>
<td>M </td>
<td>499</td>
</tr>
<tr>
<td>T-shirt 2</td>
<td>M </td>
<td>499</td>
</tr>
</tbody>
</table>

$(“#tbl_Id”).DataTable({
destroy: true,

“paging”: true, initComplete: function () {
var api = this.api();
api.columns().indexes().flatten().each(function (i) {
try {
if (i == 1) {
var column = api.column(i);
$($(“#tbl_Id .filter th:eq(” + i + “)”).empty()).find(“select”).remove();
var select = $(‘All’)
.appendTo($(“#tbl_Id .filter th:eq(” + i + “)”).empty())
.on(‘change’, function () {
var val = $.fn.dataTable.util.escapeRegex(
$(this).val()
);
column
.search(val ? ‘^’ + val + ‘$’ : ”, true, false)
.draw();
});
column.data().unique().sort().each(function (d, j) {
if (d != “”)
select.append(” + d + ”)
});
}
} catch (e) { }
});
}
});

Retrieve comma separated column name with list of table name in SQL Server

Select distinct TABLE_NAME,
substring(
(
Select ‘,’+ST1.column_Name AS [text()]
From INFORMATION_SCHEMA.COLUMNS ST1
Where TABLE_NAME =ST2.TABLE_NAME
For XML PATH (”)
), 2, 1000) Columns
From INFORMATION_SCHEMA.COLUMNS ST2

 

Results

TABLE_NAME Columns
ExampleTable PriKey,timestamp,Name
region id,State,ZipCode,City,County
Sheet1$ State,Zip Code,City,Country
TestPri ID,Uname
TestT Name,TID,ID