GridView Export to Excel
protected void lnk1_Click(object sender, EventArgs e)
{
GridViewExportUtil.Export(Guid.NewGuid().ToString(“N”).Substring(0, 6) + “.xls”, this.GridView1);
}
.CLASS
| Subcribe via RSS
protected void lnk1_Click(object sender, EventArgs e)
{
GridViewExportUtil.Export(Guid.NewGuid().ToString(“N”).Substring(0, 6) + “.xls”, this.GridView1);
}
.CLASS
SELECT
CONVERT(VARCHAR(8),GETDATE(),108) as HourMinuteSeconds
Ip adres’i parametre olarak gönderiyoruz Kullanıcının İL ve Plaka gibi bilgilerinin xml olarak alıyoruz…
Çıktı: 78.177.2.252 OK TR Turkey 34 Istanbul Istanbul 41.0186 28.9647 0 0 0
System.Xml.Linq.XDocument doc = System.Xml.Linq.XDocument.Load(”http://ipinfodb.com/ip_query.php?ip=” + Context.Request.ServerVariables["REMOTE_ADDR"] + “”);
var kisiler = from p in doc.Elements(”Response”) select p;
string location = “”;
foreach (var item in kisiler)
{
location = item.Element(”City”) != null ? item.Element(”City”).Value : “”;
}
Eğer ki @metin’in içinde Beşiktaş varsa sıfırdan farklı bir rakam, yoksa sıfır değeri dönücektir.
DECLARE @metin varchar(64)
SELECT @metin = ‘Küfüre karşıyız Biz Beşiktaşlıyız’ +
‘ Spor Dostluk Kardeşliktir’
SELECT CHARINDEX(’Beşiktaş’, @metin)
private void dataGridView1_MouseDown(object sender, MouseEventArgs e)
{
DataGridView.HitTestInfo hit = dataGridView1.HitTest(e.X, e.Y);
if (hit.RowIndex >= 0)
{
dataGridView1.ClearSelection();
dataGridView1.Rows[hit.RowIndex].Selected = true;
dataGridView1.ContextMenuStrip.Show(this.dataGridView1, new Point(e.X, e.Y));
}
}
Insert Into Select (Var olan tabloya bir başka tablodan insert)
insert into cutomerCopy (customername, customersurname)
select customername, customersurname from Customer
Select into (into’dan sonra yazılan tablo ismi verilen kolon isimlerine göre 0′dan oluşturulup yapılan insert)
select customername , customersurname into CustomerCopy
from customer
Color.FromName(”#AED47D”);
int numero;
string valuto=”trying”;
bool isnum=int.TryParse(valuto, out numero);
int numero_return= isnum==true: valuto?0;
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == “Delete”)
{
GridViewRow row = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
int index= row.RowIndex;
}
}
protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName==”Save”)
{
string datakeyvalue= DataList1.DataKeys[e.Item.ItemIndex].ToString();
}
}