by Behlul
6. September 2011 15:29
şöyle güzel bir özellik varmış yeni öğrendım.
yayındaki sitenizde bakım yapmak yada kod atmak isterseniz
projenin root'una App_Offline.htm atarsak iis bunu algılıyor ve hangi sayfaya istek gönderilirse gönderilsin App_Offline.htm'i gösteriyor.
Birde şöyle bir not var : iis 512kb den düşük bir dosyanız varsa iis kendi sarı sayfa hatasını gösteriyor içeriği hazırlarken buna dikkat etmelisiniz.
by Behlul
6. September 2011 12:30
Use HTTPServerUtility.Transfer instead of Response.Redirect
Redirect’s are also very chatty.
They should only be used when you are transferring people to another physical web server.
For any transfers within your server, use .transfer! You will save a lot of needless HTTP requests.
by Behlul
5. September 2011 12:30
by Behlul
26. January 2011 11:03
SELECT post.id, post.title, comment.id, comment.message
FROM post
OUTER APPLY
(
SELECT TOP 1 *
FROM comment с
WHERE comment.post_id = post.id
ORDER BY
date DESC
) comment
or
SELECT *
FROM (
SELECT post.id, post.title, comment.id, comment.message,
ROW_NUMBER() OVER (PARTITION BY post.id ORDER BY comment.date DESC) AS rn
FROM post
LEFT JOIN
comment
ON comment.post_id = post.id
) q
WHERE rn = 1
The former is more efficient for few posts with many comments in each;
the latter is more efficient for many posts with few comments in each.
from : http://stackoverflow.com/questions/2281551/tsql-left-join-and-only-last-row-from-right
by Behlul
11. January 2011 10:36
SELECT name, create_date, modify_date FROM sys.objects WHERE type = 'P' order by modify_date desc
17b754ba-639c-4ab0-9a49-ca6c9830c812|0|.0
Tags:
Coding | Hint
by Behlul
18. October 2010 18:00
CREATE TABLE Product
(
ProductID INT IDENTITY(1,1) PRIMARY KEY,
Price Decimal NOT NULL DEFAULT 0,
Quantity INT NOT NULL DEFAULT 0,
TOTAL AS Price * Quantity
)
6d5edb85-8702-4509-aa53-9fd9121d46a3|1|2.0
Tags:
Coding | Hint
by Behlul
29. June 2010 13:30
<img src='<%# DataBinder.Eval(Container.DataItem, "Resipe_Image", "upload_resize/{0}XL.jpg") %>' height="100" width="100" border="0" alt="" onerror="this.src='upload_resize/download.png'" />
by Behlul
31. March 2010 10:22
USE [master]
GO
ALTER DATABASE [Visitor] MODIFY FILE ( NAME = N'Visitor_log', MAXSIZE = UNLIMITED)
GO
by Behlul
31. March 2010 10:09
USE VisitorLog
GO
DBCC SHRINKFILE('VisitorLog_log', 1)
BACKUP LOG VisitorLog WITH TRUNCATE_ONLY
DBCC SHRINKFILE('VisitorLog_log', 1)
GO
DBCC SHRINKDATABASE (VisitorLog, 0);
by Behlul
5. January 2010 17:35
Sessionlarımızı kalıcı olarak sql de tutmak için
MSSQL'imizi kurduktan sonra
Comand prompt'tan
mevcut framework klasörüne erişip aşağıdaki kodu çalıştırdığımızda ilgili tabloların yartılıdığını görürürüz
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regsql.exe -ssadd -sstype p -U sa -P sasifresi -S .
Burdaki -P yi yazmazssak ilgili tabloların yaratılmadıgını göreceğiz bu aspstatelerin tempdb'sinde tutulmasını sağlar
daha fazla bilgi için;
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regsql.exe -?
yazarak açıklamaları okumanızı tavsiye ederim
şimdi web config dosyamıza
<
sessionState mode="SQLServer" stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=ilgiliserver; user id=kullaniciID;password=sifre"
/>
yazmamız yeterli olacaktır.
by Behlul
29. December 2009 05:45
SELECT *
FROM(
SELECT *,
ROW_NUMBER() OVER (PARTITION BY TestMasterID ORDER BY TestMasterID desc ) as pos
FROM TestDetay
)as Detay INNER JOIN TestMaster as Master on Master.TestMasterID=Detay.TestMasterID
Where Detay.pos >2
by Behlul
25. December 2009 07:43
<head>
<META HTTP-EQUIV="refresh" content="3;URL=banu.htm">
</head>
by Behlul
25. December 2009 07:37
Şöyle güzel bir site açalım. Bol resim yazı grafik falan olsun.
sonra adres çubuğuna java script kodunu kopyala yapıştır yapalım.
Şimdi boş durmayalım sayfayı kendimize göre düzenleyelim.
Sürükle bırak metodu ile herşeyi serbestce değiştirebilirsiniz.
iyi eğlenceler :)
javascript:void(document.body.contentEditable="true");
by Behlul
8. December 2009 19:25
Aynı Sayfa içinde window.location.href ' le verince Firefox ve chrome da sayfa postback oluyor.
bunun yerine window.location.hash kullanılırsa sorun çözülüyor....
< a onclick="selectTab(2);" style="cursor: pointer;"><script type="text/javascript"
$(document).ready(function(){
$(
"#tabs").tabs();
});
function selectTab(tab) {
var $tabs = $('#tabs').tabs();
$tabs.tabs('select', tab);
var locationObj = "#tabs"; return false;
window.location.hash = locationObj;
}
</script>
by Behlul
6. October 2009 16:10
if (window.addEventListener)
window.addEventListener('load', function, false)
else if (window.attachEvent)
window.attachEvent('onload', function);
else if (document.getElementById)
window.onload=function;
by Behlul
9. September 2009 16:34
Sometimes even the simplest things can make a difference. One of these simple items that should be part of every stored procedure is SET NOCOUNT ON. This one line of code, put at the top of a stored procedure turns off the messages that SQL Server sends back to the client after each T-SQL statement is executed. This is performed for all SELECT, INSERT, UPDATE, and DELETE statements. Having this information is handy when you run a T-SQL statement in a query window, but when stored procedures are run there is no need for this information to be passed back to the client.
By removing this extra overhead from the network it can greatly improve overall performance for your database and application.
If you still need to get the number of rows affected by the T-SQL statement that is executing you can still use the @@ROWCOUNT option. By issuing a SET NOCOUNT ON this function (@@ROWCOUNT) still works and can still be used in your stored procedures to identify how many rows were affected by the statement.
by Behlul
4. September 2009 18:44
Management studio'da kısa yolları kaydetmek için Tools ==> Options ==> Keybord seçerek
istenilen tuş kombinasyonuna ister yazdığımız bir function, ister bir store procedure atayabiliyoruz.
atamadan sonra Management Studio'yu tekrar başlatmak gerekiyor...

by Behlul
12. February 2008 07:24
Aklımızda, blogumuzda dursun
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
btnEKTalepEkle.Attributes.Add(
"onclick", "btnEKTalepEkle.disabled=true;" & Me.GetPostBackEventReference(Me.btnEKTalepEkle))
End If
by Behlul
14. January 2008 07:46

Budur....
by Behlul
3. October 2007 07:30
Bildiğiniz gibi asp.net uygulamalarında textboxlara karakter sınırı koymak için maxlength adlı propertisini kullanabiliriz.
Fakat textbox'ın textmode=multiline yapınca her nedense bu property çalışmıyor.(Bug mı acaba?)
Bu sorunu ekteki javascript'i kullanarak aşabiliriz.
<script type="text/javascript" language="JavaScript">
function textCounter(field,cntfield,maxlimit) {
if (field.value.length > maxlimit)
field.value = field.value.substring(0, maxlimit);
else
cntfield.value = maxlimit - field.value.length;
}
</script>
<table>
<tr>
<td>
<input readonly type="text" name="Sayac" maxlength="3" value="230" style="width: 29px" />
Kalan karakter sayısı
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtKisitli" Width="250px" Height="100px" TextMode="MultiLine"
onKeyDown="textCounter(document.aspnetForm.txtKisitli,document.aspnetForm.Sayac,230)"
onKeyUp="textCounter(document.aspnetForm.txtKisitli,document.aspnetForm.Sayac,230)">
</asp:TextBox>
</td>
</tr>
</table>