Category: .Net


Crystal Reports (v13) Visual Studio 2010

Yaklaşık bir seneden beri merakla beklediğim Crystal Reports’un Visual Studio 2010 için olan sürümü sonunda dağıtım sürümüne ulaştı. Yeniliklerden bazıları şöyle:

  • WPF için görüntüleyici desteği (WPF based Crystal Reports Viewer control)
  • Basitleştirilmiş paket
  • Adobe Flash desteği

Crystal Reports v13 Visual Studio 2010

Benim testlerime göre:

  • Raporlar daha hızlı yüklenmekte ve beklemeyi minimuma indirmekte.
  • Görüntüleme dili olarak Türkçe desteği eklenmiş.
  • Rapor boyutu olarak kullanıcı tanımlı boyut eklenmiş (tam test edemedim)

Crystal Reports’un yeni versiyonunu şuradan indirebilirsiniz.

C# ile metin sıralamalarını değiştirme

Veritabanından çektiğim kategori navigasyonu için tekrardan veritabanı işlemleri yapmamak adına pratik bir fonksiyon yazayım dedim. Fonksiyon Ürünler » Çikolatalar » Alpella gibi bir metinsel ifadeyi Alpella « Çikolatalar « Ürünler şekline çevirmekte kullanılabilir. Stackoverflow’da sorduğum soruya daha kısa alternatif ise Linq sınıfını kullanan bir kod tavsiye edildi. Onu da altta veriyorum.


public static string ReverseString(string input, string separator, string outSeparator)
{
string result = String.Empty;
string[] temp = Regex.Split(input, separator, RegexOptions.IgnoreCase);
Array.Reverse(temp);
for (int i = 0; i < temp.Length; i++)
{
result += temp[i] + " " + outSeparator + " ";
}
return result;
}

Not: System.Text.RegularExpressions sınıfını kullanır.

Stackoverflow alternatifi:


public static string ReverseString(string input, string separator, string outSeparator)
{
return String.Join(" " + outSeparator + " ", input.Split(new[] { " " + separator + " " }, StringSplitOptions.RemoveEmptyEntries).Reverse().ToArray());
}

Not: System.Linq sınıfını kullanır.

Ayrıca stackoverflow tavsiyelerine göre fonksiyonu StringBuilder ile kullanmak uzun metinsel ifadelerde performans sağlayacaktır:


public static string ReverseString(string input, string separator, string outSeparator)
{
StringBuilder result = new StringBuilder();
string[] temp = Regex.Split(input, separator, RegexOptions.IgnoreCase);
Array.Reverse(temp);
for (int i = 0; i < temp.Length; i++)
{
result.Append(temp[i] + " " + outSeparator + " ");
}
return result.ToString();
}

Today I got this error while I was coding a cms panel. I’ve researched for solution but there was nothing to do with most of them. Then I’ve looked up my code and I’ve realized that I haven’t closed my reader. After I added rdr.Close(); to my code block before closing using statement, problem was solved.

Also you can add rdr.Dispose(); In my code I delete previous uploaded files and sometimes it gives error when the file that needs to be deleted is already deleted. And this is the reason why command cannot be closed. So close and dispose the reader. Problemo solved :)

Error:
COM object that has been separated from its underlying RCW cannot be used.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.InvalidComObjectException: COM object that has been separated from its underlying RCW cannot be used.

Stack Trace:

[InvalidComObjectException: COM object that has been separated from its underlying RCW cannot be used.]
   System.Data.Common.IAccessor.ReleaseAccessor(IntPtr hAccessor, Int32& pcRefCount) +0
   System.Data.OleDb.RowBinding.Dispose() +86
   System.Data.OleDb.Bindings.Dispose() +30
   System.Data.OleDb.OleDbCommand.CloseInternalParameters() +18
   System.Data.OleDb.OleDbCommand.ResetConnection() +23
   System.Data.OleDb.OleDbCommand.Dispose(Boolean disposing) +27
   System.ComponentModel.Component.Dispose() +17
   Admin_addContent.LoadCategory() in z:\siteRoot\*.com\Admin\addContent.aspx.cs:223
   Admin_addContent.Page_Load(Object sender, EventArgs e) in z:\siteRoot\*.com\Admin\addContent.aspx.cs:29
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

System Error &H80070714&

TR: .net ikon hatasıdır. Geçerli projede kullanmakta olduğunuz simge büyük ihtimal vista sıkıştırması içeriyor. Bunu değiştirin ya da çıkartın. Bahsedilen ikonlar Windows Resim ve Faks Görüntüleyicisi’nde de görülememekte.

EN: .net icon error. Change or remove the icon you are using in current project. In case of using an icon, containing size 256×256 Vista format (These icons which you can’t preview with Windows Picture and Fax Viewer), vb.net produces this error.

full error:

Error 1 Unable to write to output file ‘X:\Projects\obj\Debug\WindowsApplication1.exe’: System Error &H80070714&

WordPress.com'dan blog alın. | Tema Motion, volcanic tarafından yapılmıştır.
Takip Et

Get every new post delivered to your Inbox.