Archive for Giugno, 2008

ExecuteDataTable With Multible Parameters

CodeKeep C# Feed Giugno 30th, 2008

Description: ExecuteDataTable With Multible Parameters (Paging?)

Link: http://www.codekeep.net/snippets/188dacd9-459c-4043-9ff2-1cded2bf33c4.aspx

public DataTable GetDataResults(string parameter, int pageIndex, int pageSize)
{
	MyDbParameterCollection parameters = dbHelper.CreateParameterCollection();
	parameters.AddWithValue("@Parameter", parameter);
	parameters.AddWithValue("@PageIndex", pageIndex);
	parameters.AddWithValue("@PageSize", pageSize);
	return dbHelper.ExecuteDataTable(commandText, parameters.ToArray());
}

ExecuteDataTable With Single Parameter

CodeKeep C# Feed Giugno 30th, 2008

Description: ExecuteDataTable With Single Parameter

Link: http://www.codekeep.net/snippets/0298a377-504e-47fb-9382-c4d87bd6ca20.aspx

public DataTable GetDataResult(string parameterValue)
{
    DbParameter parameter = dbHelper.CreateParameterWithValue(":Parameter", parameterValue);
    return dbHelper.ExecuteDataTable(commandText, parameter);
}

Static SQL Query String

CodeKeep C# Feed Giugno 30th, 2008

Description: Static SQL Query String

Link: http://www.codekeep.net/snippets/a95d7333-77fc-4532-ae74-d91384e073f6.aspx

public static string sqlQueryName = "";

How to Create an Ajax Autocomplete Text Field: Part 6

WebReference News Giugno 29th, 2008

In part 5 of the series, the AutocompleteList JavaScript file, we wrote the client-side script to manage the behavior of the Autocomplete control in the browser. This week we're going to finish the remaining Web files, including the AutocompleteSearch.jsp page. 0515

Software Engineering for Ajax

WebReference News Giugno 29th, 2008

A great advantage of using the Google Web Toolkit (GWT) when building Ajax applications is leveraging advanced software engineering. This week you'll learn how to use the Java software engineering tools in GWT to build high-quality Ajax applications. By Ryan Dewsbury. 0512

Perl Pragma Primer

WebReference News Giugno 29th, 2008

Pragmas in Perl are specific instructions that we can embed in Perl code, depending on our needs and preferences, that allow our scripts to be compiled and behave differently than they would otherwise. In this article, we look at how pragmas work. By Dan Ragle. 0508

Reporting

CodeKeep C# Feed Giugno 27th, 2008

Description: SQL Reporting Services

Link: http://www.codekeep.net/snippets/2842c9e2-d540-489c-9ef4-a22be21ed550.aspx

Custom Function:
Dim InvNo as integer =0
Function GetInvNo(InvoiceNo as integer)
If(InvNo=0)
 InvNo = InvoiceNo
Else
 InvNo = InvNo + 1
End If
return InvNo
End Function

Calling Reports
ASPX.CS
btn_Click()
{
....
Url.Append("<Script language='javascript'>");

Url.Append("OpenReport('" + reportserverurl + "')");

Url.Append("</Script>");

ClientScript.RegisterStartupScript(typeof(Page), "Url", Url.ToString());

}


Javascript ASPX
function OpenReport(Path)

{

RptObj=window.open(Path,"Report", "width=750,height=600,left=25,resizable=yes,top=25,screenX=" +window.screenLeft+",screenY=" +window.screenTop+",scrollbars=yes");

RptObj.focus();

}

Inserting data thru Views

CodeKeep C# Feed Giugno 27th, 2008

Description: Inserting data thru Views

Link: http://www.codekeep.net/snippets/28815537-005c-40d5-b452-b31bee393306.aspx

select * from test1
select * from test

insert into test1 values ('a')

alter view tstView

as

select distinct T.[Name],T.[No] from test T,test t1 where T.[name] = t1.[name]

 

select * from tstview

insert into tstview ([name],[no]) values('fd',18)

Attributes

CodeKeep C# Feed Giugno 27th, 2008

Description: Adding attributes

Link: http://www.codekeep.net/snippets/551344a8-c0a9-41ea-963e-7144ca57f0e9.aspx

<body id="bodyHomePage" Runat="Server">

And then in your Page_Load do something like this:

bodyHomePage.Attributes.Add("onLoad", "alert('Welcome visitor')")

<%=string%>

ArrayList ListBox

CodeKeep C# Feed Giugno 27th, 2008

Description: ListBox population from XML

Link: http://www.codekeep.net/snippets/f2a539eb-e663-453d-870d-7b203d189cb1.aspx

private void button2_Click(object sender, EventArgs e)

{

IsDataSet = false;

DataSet ds = new DataSet();

ds.ReadXml("http://www.eggheadcafe.com/rss.xml");

DataTable dt = ds.Tables[2];

ArrayList al = new ArrayList();

string thename;

string thevalue;

foreach (DataRow row in dt.Rows)

{

thename = (string)row["title"];

thevalue = (string)row["link"];

al.Add (new CustomItem(thename,thevalue)); 

}

listBox1.DataSource =al; 

}

Next »