Code Snippets - ASP.NET, C#, JAVA, Android. Tutorials, Code Snippets, Bug Fixing etc
![]() |
| Hostgator Offers |
public static bool HasNull(this DataTable table)
{
foreach (DataColumn column in table.Columns)
{
if (table.Rows.OfType<DataRow>().Any(r => r.IsNull(column)))
return true;
}
return false;
}
and use
table.HasNull();
DBNull.Value value to filter and manage null values in whatever way you see fit.
foreach(DataRow row in table.Rows)
{
object value = row["ColumnName"];
if (value == DBNull.Value)
// do something
else
// do something else
}
Check More About DBNull Class
![]() |
| Get 25% Off on HostGator Hosting Coupon Code |
string file = Server.MapPath ("abc.html");
StreamReader sr;
FileInfo fi = new FileInfo(file);
if(File.Exists(file))
{
sr = File.OpenText(file);
input += sr.ReadToEnd();
sr.Close();
}
string[] lines = File.ReadAllLines("path/to/my/file.html");
foreach(string line in lines)
{
Response.Write(line);
}
Copyright @ 2013 Code Snippets.