public DataSet ConvertDataReaderToDataSet(OleDbDataReader reader)
{
DataSet dataSet = new DataSet();
DataTable schemaTable = reader.GetSchemaTable();
DataTable dataTable = new DataTable();
for(int cntr = 0; cntr < schemaTable.Rows.Count; ++cntr )
{
DataRow dataRow = schemaTable.Rows[cntr];
string columnName = dataRow["ColumnName"].ToString();
DataColumn column = new DataColumn(columnName,dataRow.GetType());
dataTable.Columns.Add(column);
}
dataSet.Tables.Add(dataTable);
while (reader.Read())
{
DataRow dataRow = dataTable.NewRow();
for(int cntr = 0; cntr < reader.FieldCount; ++cntr)
{
dataRow[cntr] = reader.GetValue(cntr);
}
}
return dataSet;
}
Friday, September 30, 2005
.Net C# howto convert DataReader to Dataset
at 10:20 AM 1 comments Posted by roni schuetz
Wednesday, September 28, 2005
The request failed with HTTP status 401: Unauthorized "System.Net.WebException: The request failed with HTTP status 401: Unauthorized".
The request failed with HTTP status 401: Unauthorized
"System.Net.WebException: The request failed with HTTP
status 401: Unauthorized".
If you use an authentication on your webservice like
Integrated Windows Authentication, you may have
to pre-authenticate before using your webservice:
WebService.webClass myWC= new WebService.webClass();
myWC.PreAuthenticate = true;
myWC.Credentials = System.Net.CredentialCache.DefaultCredentials;
posted on Friday, January 30, 2004 8:37 AM on "Heybo Blog"
http://heybo.com/weblog/posts/245.aspx
at 12:40 PM 0 comments Posted by roni schuetz
Tuesday, September 20, 2005
Convert ArrayList into Array
example:
ArrayList myArray = new ArrayList();
--- somewhere in your code you populate your array
--- then...
int[] myIntArray = (int[])myArray.ToArray(typeof(int));
provided by luiz ( thanks mate )
at 5:03 PM 0 comments Posted by roni schuetz
Thursday, September 15, 2005
Run IE trough batch job...
Dim wshShell
set wshShell = WScript.CreateObject("WScript.Shell")
wshShell.Run "cmd.exe /c ""title StartIE & runas.exe /user:virtual\bsz ""%ProgramFiles%\Internet Explorer\IEXPLORE.EXE"""""
wscript.Sleep(1000)
wshShell.AppActivate "StartIE"
wshShell.SendKeys "I'm2Happy" & "{ENTER}"
at 4:01 PM 0 comments Posted by roni schuetz
Monday, September 12, 2005
Regular Expression Email Check
Function ValidateEmail(Expression)
Dim objRegExp
Set objRegExp = New RegExp
objRegExp.Pattern = "^[\w\.-]+@[\w\.-]+\.[a-zA-Z]+$"
ValidateEmail = objRegExp.Test(Expression)
End Function
at 5:15 AM 0 comments Posted by roni schuetz