|
Yes it is possible dear
follwoing code may be help full
//HTMl Document
public void Create_HTML_Document(string strBody,string filename)
{
try
{
string header = "<title>News letter";
header += strBody;
header += "";
header += "";
StreamWriter sw = File.CreateText(Server.MapPath("../NewsLetters/") + filename +".txt");
sw.Write(header);
sw.Close();
}
catch (Exception)
{
}
}
Naveed Kamboh
Complexity kills, Write easy code for your self.
isolutionteam
|
|
|
|
|
Hi,
i have a table with an INT column. The value is either 0 or 1. (It is a flag).
Now i'd like to bind it to an checkbox. 1 for checked. 0 for unchecked.
I tried this:
<asp:CheckBox ID="chkOutIn2" runat="server" Checked='<%# Bind("flag_out") %>' Text="Out" />
But i get an exception.
How do i get this checkbox checked?
(The update is no problem, i can convert the bool i get)
Thank you.
|
|
|
|
|
Try to do it on DataBinding event of Check box.
Hopefully it will work.
Naveed Kamboh
Complexity kills, Write easy code for your self.
isolutionteam
|
|
|
|
|
if it return only 0 and 1 then u can use the bool.parse() method,it will convert the value to bool, please check that
|
|
|
|
|
Ok i'll try it, but would you post an example how to integrate this method in my line? That's the biggest problem i have
|
|
|
|
|
hi,
how i will add rootnode,node and subnode dinamically to a treeview control
plz help.
p.sethi
|
|
|
|
|
Hi following code migth help you
//Populate treeview at root level
public void PopulateRootLevel( TreeView tv)
{
DataTable dt = new DataTable();
string sql = "SELECT MenuId,MenuName,MenuDescription,LinkName,(Select count(*) from menus where Parentid=mns.MenuId and menus.Status='Yes') as childnodecount,SecurityLevel FROM `menus` mns WHERE mns.Status = 'Yes' and mns.parentid is null";
try
{
connectToDB();
MySqlCommand cmdRoot = new MySqlCommand(sql, connection);
MySqlDataAdapter da = new MySqlDataAdapter(cmdRoot);
da.Fill(dt);
}
catch (Exception)
{
}
finally
{
connection.Close();
connection.Dispose();
}
PopulateNodes(dt, tv.Nodes);
}
//Populate nodes
private void PopulateNodes(DataTable dt, TreeNodeCollection nodes)
{
foreach (DataRow dr in dt.Rows)
{
TreeNode tn = new TreeNode();
tn.Text = dr["MenuName"].ToString();
tn.Value = dr["MenuID"].ToString();
tn.ToolTip = dr["MenuDescription"].ToString();
tn.NavigateUrl = dr["LinkName"].ToString();
nodes.Add(tn);
//If node has child nodes, then enable on-demand populating
tn.PopulateOnDemand = int.Parse(dr["childnodecount"].ToString()) > 0;
}
}
Naveed Kamboh
Complexity kills, Write easy code for your self.
isolutionteam
|
|
|
|
|
How to I use the top and left properties in ASP? I want to position my controls.
|
|
|
|
|
Are you adding the controls dynamically or or static ?
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
How to store data from one table to another table in different databases using webservices?
|
|
|
|
|
In .net fetch data in a DataSet and from your web service return this DataSet.
then you can use this DataSet.
for example using asp.net i created a webservice which is fetching data from Sql server then
I am passing this data to mysql server.
Do not hesitate for further question.
Naveed Kamboh
Complexity kills, Write easy code for your self.
isolutionteam
|
|
|
|
|
hi guys,
i'm using asp.net to build web application.
how can i store image in sql server express edition, and display it
at the web.
|
|
|
|
|
Store an image, or any binary information in a varbinary(max) column. In order to store or retrieve it you must use a byte[] . In order to display it you can create a special ASPX that overrides the existing render process and writes out binary information instead.
|
|
|
|
|
hi,
i new to asp.net
i still cant understand about "create a special ASPX that overrides the existing render
process"....
can you pliz show me just VERY VERY simple example on how to display the image.
|
|
|
|
|
Create an aspx page, remove all markup except the @Page tag, and use BinaryWrite to output the image data:
int id = int.Parse(Request.QueryString["id"]);
byte[] imageData = YourDataBaseCallToGetImageData(id);
Response.ContentType = "image/jpeg";
Response.BinaryWrite(imageData);
Put the address of the page as src in an image tag:
<img src="ShowImage.aspx?id=42">
---
single minded; short sighted; long gone;
|
|
|
|
|
hi all,
can anyone provide a very very good meterial for oops
|
|
|
|
|
praveenanand wrote: can anyone provide a very very good meterial for oops
A banana skin?
Seriously, you'll have to be more specific. You might also want to read up on Design Patterns.
|
|
|
|
|
hi Buddy,
u have not given any specifications but i think this links will help u
OOPs Concepts and .NET Part 1: Classes, Objects, and Structures
http://www.c-sharpcorner.com/Code/2005/June/OOPSand.NET1.asp
OOPS Concepts and .NET Part 2: Inheritance, Abstraction, & Polymorphism
http://www.c-sharpcorner.com/Code/2005/June/OOPSand.NET2.asp
Max-Be Cool
|
|
|
|
|
Better try to search from Google
Develop2Program & Program2Develop
|
|
|
|
|
hi all
I want to schedule to export report to email plz ant body hel me
Regards
nitin(nitin.kankrej@gmail.com)
ok
|
|
|
|
|
how to split pharse from search keyword..
for example my search string in search text box is :
"how to 'split phrase' from search 'string in texbox' while user serch something"
then how i can get the phrase "split phrase" and "string in texbox"
thanking you.
Jes
|
|
|
|
|
You can use a regular expression that matches text in apostrophes. Use the pattern "'(.*?)'".
---
single minded; short sighted; long gone;
|
|
|
|
|
can u explani how we can use it.
|
|
|
|
|
soory.
also the phrase will in double quotes not in single quotes..
how to "split phrase" from search "string in texbox" while user serch something
so if know abt this explain it
thanking you.
|
|
|
|
|
Put quotes instead of the apostrophes in the pattern.
Use the Regex.Matches method with the input string and the pattern as arguments. This returns a MatchCollection object that contains the matched strings.
---
single minded; short sighted; long gone;
|
|
|
|