Deepankar's profile.NET Rocks!!!PhotosBlogListsMore Tools Help
No folders have been shared yet.

Talking about the U.S. Fund for UNICEF campaign

 

The log file for database is full. Back up the transaction log for the database to free up some log space.

When dealing with MS SQL (not MY SQL) I’ve seen this error message before, but found little help on it out there.
 
The log file for database db_name is full. Back up the transaction log for the database to free up some log space.
 
Within the MS SQL Query Analyzer, do this:
backup log db_name with truncate_only
go
dbcc shrinkfile (db_name_log,0)
go
 
If anything, this post will be useful for me in the future when one of my MS SQL databases coughs up the error again

Talking about Blogging: Design Your Own Weblog Application from Scratch Using ASP.NET, JavaScript, and OLE DB

 

Quote

Blogging: Design Your Own Weblog Application from Scratch Using ASP.NET, JavaScript, and OLE DB
The ASP.NET advanced templated controls, such as the DataList and DataGrid, are perfect for many data representation situations. However, when you need the flexibility to render a variety of layouts, the Repeater control is what you need. In this article the author builds a full-featured blog application to illustrate the use of the Repeater and DataList controls that render nested data in a master-detail relationship. He then discusses how to override the default implementations of these controls by adding some client-side JavaScript code that makes the blog more responsive and enhances its usability.

Paint Ball

Have started working on a new site www.urbanpaintball.co.nz, very interesting game, where people hit each other with colored balls and pretend to be dead. Can you believe this game has national and international tournaments.
 
Will keep you posted more on this game as we progress with the site:)

Convert a DataSet to a String Variable

Coverts a DataTable into an Excel string.  Use this method to save a datatable as an Excel file.  It loops through each of the DataTables in the DataSet. There is also an option of whether to print the table headers (column names).

public static string DataSetToString(DataSet dataSet, string title ,  bool printHeaders)
{
StringBuilder sb = new StringBuilder();
// start the excel file headers
sb.Append("<html xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" ");
sb.Append("xmlns=\"http://www.w3.org/TR/REC-html40\"><head><meta http-equiv=Content-Type content=\"text/html; charset=windows-1252\">");
sb.Append("<meta name=ProgId content=Excel.Sheet><meta name=Generator content=\"Microsoft Excel 9\"><!--[if gte mso 9]>");
sb.Append("<xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>" + title + "</x:Name><x:WorksheetOptions>");
sb.Append("<x:Selected/><x:ProtectContents>False</x:ProtectContents><x:ProtectObjects>False</x:ProtectObjects>");
sb.Append("<x:ProtectScenarios>False</x:ProtectScenarios></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets>");
sb.Append("<x:ProtectStructure>False</x:ProtectStructure><x:ProtectWindows>False</x:ProtectWindows></x:ExcelWorkbook></xml>");
sb.Append("<![endif]--></head><body><table>");

// Start the excel worksheet
sb.Append("</table><table><tr><td colspan=\"4\"><h3><b>" + title + "</b></h3></td></tr></table>");
sb.Append("</table><table><tr><td></td></tr></table>");

for (int table = 0; table < dataSet.Tables.Count; table++)
{
sb.Append("<table>");
if (printHeaders)
{
sb.Append(string.Format("<TR><td colspan = \"{0}\"><B>{1}</b></td></tr>",
dataSet.Tables[table].Columns.Count,dataSet.Tables[table].TableName.ToUpper()));
sb.Append("<TR BgColor = \"#CCCCCC\">");

for (int iCol = 0; iCol < dataSet.Tables[table].Columns.Count; iCol++)
{
sb.Append("<td><b>" + dataSet.Tables[table].Columns[iCol].ColumnName + "</b></td>");
}
sb.Append("</TR>");
}

for (int iRow = 0; iRow < dataSet.Tables[table].Rows.Count; iRow++)
{
sb.Append("<TR>");
for (int iCol = 0; iCol < dataSet.Tables[table].Columns.Count; iCol++)
{
sb.Append("<td>" + dataSet.Tables[table].Rows[iRow][iCol] + "</b></td>");
}
sb.Append("<TR>");
}

sb.Append("</table><table><tr><td></td></tr></table>");
}
return sb.ToString();
}

 
There are no photo albums.

.NET Rocks!!!

Deepankar Raizada

Occupation
Location