Feeds:
Posts
Comments

Archive for February, 2006

case in sql(a nice sql query)

This is a nice sql query, I was afraid with a table and finally i got WITH CASE which helped me to implement confition in query. nice……..
SELECT CASE WHEN price IS NULL THEN ‘Not yet priced’ WHEN price = 10 and price THEN ‘Very Reasonable Title’ WHEN price >= 10 and price <= 20 THEN ‘Coffee [...]

Read Full Post »

using Calendar control in ASP.NET

 

This is a nice Calendar in ASP

<form name=”form1″ runat=server><asp:Label id=”Label1″ style=”Z-INDEX: 101;runat=”server”></asp:Label>
<asp:calendar id=”Calendar1″ runat=”server”
OnSelectionChanged=”Date_Selected” SelectWeekText=”week”
SelectMonthText=”month” SelectionMode=”DayWeekMonth”
NextPrevFormat=”ShortMonth” Font-Size=”12px”
Font-Name=”Verdana”>
<TodayDayStyle Font-Bold=”True” />
<DayHeaderStyle Font-Bold=”True” />
<OtherMonthDayStyle ForeColor=”gray” />
<TitleStyle BackColor=”#3366ff” ForeColor=”white” Font-Bold=”True” />
<SelectedDayStyle BackColor=”#ffcc66″ Font-Bold=”True” />
<NextPrevStyle ForeColor=”white” Font-Size=”10px” />
<SelectorStyle BackColor=”#99ccff” ForeColor=”navy” Font-Size=”9px” />
</asp:calendar>
</form>

 

After writing this in your .aspx page go to .aspx.cs page and write this

protected void Date_Selected(object sender, EventArgs e)      [...]

Read Full Post »

read rss feed using c#

I read a rss from web site. Here the example

 

DataSet ds = new DataSet();

ds.ReadXml
(http://newsrss.bbc.co.uk/rss/ newsonline_world_edition/front_page/rss.xml, XmlReadMode.Auto);

DataGrid1.DataSource=ds.Tables["item"];

DataGrid1.DataBind();

 

Label1.Text=ds.Tables[3].Rows[5][1].ToString(); //read from a dataset and get a cell

Read Full Post »

important in query

Some time we want not to get null values returning from our query and to protect this need to use ISNULL. hrre is an example fo using ISNULL.

ISNULL((SELECT name FROM employee WHERE id = employeeSalary.eID), ”)

 

Name of the employee id returnig from this query but if name is null it return a space.

 

 

Sometime we need [...]

Read Full Post »

connection between SQL Server and C#.net

Hi, This is an easy thing which i have done, i establish connection between SQL Server and C#.net there is a table in my database named login. My code take name and password from textbox and and password field and then check with the databse if name and passwword is correct then redirenc to a [...]

Read Full Post »

use bangla font in java

i tried to write bangla font in a text field and have dane this successfully. Here is the source code of using bangla font in java.
     File fontFile = new File(“Boishkhi.ttf”);
     FileInputStream inStream = new FileInputStream(fontFile);
     Font banglaFont =Font.createFont(Font.TRUETYPE_FONT,inStream);
     banglaFont =banglaFont.deriveFont(Font.PLAIN,12);
     textField.setFont(banglaFont);
Here i am using Boisgakhi.tff as an example you can use any font just change [...]

Read Full Post »

read doc file from c#

I have read a word file successfully using c#.net and printing this file on a rich text editor.here is the souce code
Word.Application app=new Word.ApplicationClass();
object nullobj=System.Reflection.Missing.Value;
object file = @”C:test.doc”;
Word.Document doc = app.Documents.Open
 ( ref file, ref nullobj, ref nullobj, ref nullobj,
 ref nullobj, ref nullobj, ref nullobj, ref nullobj,
 ref nullobj, ref nullobj, ref nullobj, ref nullobj,
 ref nullobj, ref [...]

Read Full Post »