Sunday, April 4, 2010

How to Find you Black Berry PIN number

Hi

I was trying to find the BB PIN number and found the content from a article:
Type ALT CAP H on your BlackBerry keyboard and a screen will show up showing you your PIN, your IMEI number (International Mobile Equipment Identity), signal strength and battery levels etc...

Resource: http://crackberry.com/quick-way-find-your-pin

Hope it helps
4Z

Thursday, April 1, 2010

xp_sendmail: Procedure expects parameter @user, which was not supplied.

Hello...

When you try to send E-mail from your SQL Server 2005 T-SQL with xp_sendmail, there will be an error message shown as follows:

xp_sendmail: Procedure expects parameter @user, which was not supplied.

And probably when you try to pass @user also, it will say invalid parameter.

It seems in SQL Server 2005, xp_sendmail is obsolete and we can use sp_send_dbmail instead.

Following is the syntax:

EXEC msdb.dbo.sp_send_dbmail
@recipients='vm.mohammedfauzi@gmail.com',
@subject = 'SQL:DataBase Mail Test',
@body = 'Hello Test From SQL.Hello Test From SQL.',
@profile_name = 'The Profile you created in Configure Database Mail',
@body_format = 'HTML'

The following link has screen shots to setup Email Profile in SQL Server : Click Here

Hope it helps

Fauzi

Thursday, March 25, 2010

MOSS: Where to place generic Javascript in MOSS Server

Hey Reader!

(writing on demand from Mr.Murthu Buddy :))

When you need to use a javascipt in your html page in MOSS Sharepoint.

you can place the Javascript file in the following location:

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\js\mootools-1.2-core.js

and in your HTML file, you can refer it like:

<script type="text/javascript" src="http://portal/_layouts/js/mootools-1.2-core.js">
script>


Hope it Helpz


Tuesday, March 23, 2010

Sunday, March 14, 2010

Automated Blog

Hey There...

These days couldn't find enough time to blog...

So developed an automated blog!

Please view and feel free to share your thoughts...

www.KuwaitFresh.com

Best Regards
Fauzi

Wednesday, December 9, 2009

Convert DataReader To DataSet through C# Dynamically

Hi,

I was writing an application to read data from AS 400, Db2, based on the data I have to generate a report. I was trying to covert OdbcDataReader to DataSet. The following Code was helpful to do the same... We can use it for SqlDataReader as well.

Code:

public DataSet ConvertDataReaderToDataSet(System.Data.Odbc.OdbcDataReader reader)

{

DataSet dataSet = new DataSet();

do

{

// Create data table in runtime

DataTable schemaTable = reader.GetSchemaTable();

DataTable dataTable = new DataTable();

if (schemaTable != null)

{

for (int i = 0; i < schemaTable.Rows.Count; i++)

{

DataRow dataRow = schemaTable.Rows[i];

// Create a column name as provided in Schema

string columnName = (string)dataRow["ColumnName"];

// Define Column Type here

DataColumn column = new DataColumn(columnName, (Type)dataRow["DataType"]);

//Adding Column to table

dataTable.Columns.Add(column);

}

dataSet.Tables.Add(dataTable);

// Fill the data table from reader data

while (reader.Read())

{

DataRow dataRow = dataTable.NewRow();

for (int i = 0; i < reader.FieldCount; i++)

dataRow[i] = reader.GetValue(i);

dataTable.Rows.Add(dataRow);

}

}

else

{

// No records were returned

DataColumn column = new DataColumn("RowsAffected");

dataTable.Columns.Add(column);

dataSet.Tables.Add(dataTable);

DataRow dataRow = dataTable.NewRow();

dataRow[0] = reader.RecordsAffected;

dataTable.Rows.Add(dataRow);

}

}

while (reader.NextResult());

return dataSet;

}


Hope It Helpzzzz

4ZZZZ

Monday, December 7, 2009

Infopath System.Security. Permissions.EnvironmentPermission Fulltrust

Hey All,

When I tried to get current user in code behind in the infopath form, the following security exception occurred. The solution is we need to set Full trust for the Form.

Code used: nav.SelectSingleNode("//my:Myfield", NamespaceManager).SetValue(System.Environment.UserName);

Exception Message:
Request for the permission of type 'System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) at System.Security.CodeAccessPermission.Demand() at System.Environment.get_UserName() at ItemCreation.FormCode.FormEvents_Loading(Object sender, LoadingEventArgs e) at Microsoft.Office.InfoPath.Server.SolutionLifetime.FormEventsHost.<>c__DisplayClass6.<>c__DisplayClass8.b__1() at Microsoft.Office.InfoPath.Server.Util.DocumentReliability.InvokeBusinessLogic(Thunk thunk) at Microsoft.Office.InfoPath.Server.SolutionLifetime.FormEventsHost.<>c__DisplayClass6.b__0(Object sender, LoadingEventArgs e) at Microsoft.Office.InfoPath.Server.SolutionLifetime.FormEventsHost.<>c__DisplayClass34.b__30() at Microsoft.Office.InfoPath.Server.DocumentLifetime.OMExceptionManager.CallFormCodeWithExceptionHandling(UserMessages userMessages, OMCall d) at Microsoft.Office.InfoPath.Server.SolutionLifetime.FormEventsHost.FireLoadingEvent(Document document, Dictionary`2 inputParameters) at Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.PerformOnLoadEvent(Dictionary`2 intputParameters) at Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.LoadSolutionAndDocument(HttpContext context, Solution solution, DocumentMetaInformation documentMetaInformation, OnInitializeCallback onInitializeCallback, OpenParameters openParameters) at Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.OpenDocumentWithSolution(HttpContext context, SPSite contextSite, Solution solution, DocumentMetaInformation documentMetaInformation, OnInitializeCallback onInitializeCallback, OpenParameters openParameters) at Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.NewFromSolution(HttpContext context, SPSite contextSite, Solution solution, DocumentMetaInformation documentMetaInformation, Boolean disableFirstRequestOptization, OnInitializeCallback onInitializeCallback, OpenParameters openParameters) at Microsoft.Office.InfoPath.Server.Controls.XmlFormView.DataBindInternal(SolutionMetaInformation solutionMetaInformation, DocumentMetaInformation documentMetaInformation, String absoluteSolutionLocation, Boolean hasCloseHandler, Document& document) at Microsoft.Office.InfoPath.Server.Controls.FormServerPage.InitializeRenderInLine(SolutionMetaInformation solutionMetaInformation, DocumentMetaInformation documentMetaInformation, String absoluteSolutionLocation) at Microsoft.Office.InfoPath.Server.Controls.FormServerPage.NewEditingSession(SPSite contextSite, FormServerPageQueryParameters queryParameters) at Microsoft.Office.InfoPath.Server.Controls.XmlFormView.StartNewEditingSession() at Microsoft.Office.InfoPath.Server.Controls.XmlFormView.EnsureDocument(EventLogStart eventLogStart) at Microsoft.Office.InfoPath.Server.Controls.XmlFormView.<>c__DisplayClass3.b__1() at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, FinallyBlock finallyBlock) The action that failed was: Demand The type of the first permission that failed was: System.Security.Permissions.EnvironmentPermission The first permission that failed was: version="1" Read="UserName"/> The demand was for: version="1" Read="UserName"/> The granted set of the failing assembly was: version="1"> version="1" Flags="Execution"/> version="1" PublicKeyBlob="0024000004800000940000000602000000240000525341310
00400000100010083EF9CF1283A631F1C2513A36EA356E01870A92F21E61D5D53
1420B2C3905A6E3F8A0BD9E2BFAD3EAB3362877D233232ED1AE4836A1C51EAA7
717A16047A0F6F6E589F8689BCC5A15A20211252DB101B889228C5E15A3D49DC
2E112650853F16A85DD01652057E5D2CE7A41B01AA56576FFED4B4567FD8367
EE777C222C590E6"
Name="ItemCreation" AssemblyVersion="1.0.3628.18207"/> version="1" Url="file:///c:/inetpub/wwwroot/"/> version="1" Zone="MyComputer"/> version="1" Level="Minimal"/> version="1" Connections="True"/> The assembly or AppDomain that failed was: ItemCreation, Version=1.0.3628.18207, Culture=neutral, PublicKeyToken=f4d1ad1bba384fc7 The method that caused the failure was: Void FormEvents_Loading(System.Object, Microsoft.Office.InfoPath.LoadingEventArgs) The Zone of the assembly that failed was: MyComputer The Url of the assembly that failed was: file:///c:/inetpub/wwwroot/

How to set Permission: In Tools -> Form Options -> Security & trust -> Full Trust & Publish



Hope it Helpz

Thanks & Regards
Fauzi ~ 4Z