|
There are 2 sollutions :
- You can use ItemTemplate with TemplateColumn. It will be useful if you want to format the contents, and you need specific control for specific content.
- Going on SQL side, you can adjust the query itself to produce the firstname+lastname's combination, if you just want to display the information.
|
|
|
|
|
I m showing product details in datalist with a image...........and i want to enlarge the size of image on enlarge button..........how its possible..............plz guide me a bit..............
|
|
|
|
|
|
Hi,
how to upload flv file in asp.net?
Regards
jayabharathi
|
|
|
|
|
|
How we get XML tag value in MM/DD/YYYY format in .net with c# ??
<br />
private string getXmlTagDate(XmlElement xEle, string name)<br />
{<br />
XmlNodeList xList;<br />
string text;<br />
xList = xEle.GetElementsByTagName(name);<br />
if (xList.Count > 0)<br />
{<br />
text = xList[0].InnerText.ToString();<br />
text = Convert.ToDateTime(text).ToShortDateString();<br />
}<br />
else<br />
{<br />
text = "00/00/0000";<br />
}<br />
return text;<br />
}<br />
<br />
this function work properly for text value and we get this in date format
<br />
<br />
<?xml version="1.0" standalone="yes"?><br />
<NewDataSet><br />
<PinType_TABLE><br />
<pinname>HALF UNIT</pinname><br />
<fullvalue>12000</fullvalue><br />
<percent_value>50</percent_value><br />
<pin_type>P</pin_type><br />
<pin_price>6000</pin_price><br />
<ind_active>1</ind_active><br />
<CreateOn>2009-02-01T00:00:00+05:30</CreateOn><br />
</PinType_TABLE><br />
<PinType_TABLE><br />
<pinname>Full</pinname><br />
<fullvalue>12000</fullvalue><br />
<percent_value>100</percent_value><br />
<pin_type>P</pin_type><br />
<pin_price>12000</pin_price><br />
<ind_active>1</ind_active><br />
<CreateOn>2009-02-03T00:00:00+05:30</CreateOn><br />
</PinType_TABLE><br />
<PinType_TABLE><br />
<pinname>fourth unit</pinname><br />
<fullvalue>12000</fullvalue><br />
<percent_value>25</percent_value><br />
<pin_type>P</pin_type><br />
<pin_price>3000</pin_price><br />
<ind_active>1</ind_active><br />
<CreateOn>2009-05-21T00:00:00+05:30</CreateOn><br />
</PinType_TABLE><br />
<PinType_TABLE><br />
<pinname>s.s</pinname><br />
<fullvalue>12000</fullvalue><br />
<percent_value>0</percent_value><br />
<pin_type>P</pin_type><br />
<pin_price>0</pin_price><br />
<ind_active>1</ind_active><br />
<CreateOn>2009-07-16T00:00:00+05:30</CreateOn><br />
</PinType_TABLE><br />
</NewDataSet><br />
<br />
|
|
|
|
|
Just i would like to clerify you query that are facing problem with the date formate while you are converting XML file into excel file ?
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
rummer wrote:
text = Convert.ToDateTime(text).ToShortDateString();
text= Convert.ToDateTime(text).Tostring("MM/dd/yyyy");
Regards
Keyur Satyadev
|
|
|
|
|
hiii m tryin to submit the values of dynamically created textbox on button click.i have writen following code on button click:
protected void Button2_Click(object sender, EventArgs e)
{
OleDbDataReader dr = null;
string str = "Select Count(Specification)From ProductSpecification";
OleDbCommand cmd = new OleDbCommand(str, conn);
conn.Open();
string Count = cmd.ExecuteScalar().ToString();
int count = Convert.ToInt32(Count);
conn.Close();
str = "Select * From ProductSpecification";
cmd = new OleDbCommand(str, conn);
conn.Open();
for (int i = 1; i <= count; i++)
{
txt = new TextBox[count];
txt[i] = new TextBox();
txt[i].ID = "txt" + i.ToString();
string s1 = txt[i].Text;
string s2 = "Insert Into ProductSpecification(Value)Values('"+s1+"')";
cmd = new OleDbCommand(s2, conn);
cmd.ExecuteNonQuery();
}
conn.Close();
}
but it is givin error and also it is not taking the value of textbox:
error:Syntax error in INSERT INTO statement.
|
|
|
|
|
mylogics wrote: txt[i] = new TextBox(); txt[i].ID = "txt" + i.ToString(); string s1 = txt[i].Text;
Use this
txt = new TextBox();
txt= Page.FindControl("txt" & i.ToString);
string s1= txt.Text
Be an Eagle, Sky is Yours.
|
|
|
|
|
hiii now i have changed my code to:
protected void Button2_Click(object sender, EventArgs e)
{
OleDbDataReader dr = null;
string str = "Select Count(Specification)From ProductSpecification";
OleDbCommand cmd = new OleDbCommand(str, conn);
conn.Open();
string Count = cmd.ExecuteScalar().ToString();
int count = Convert.ToInt32(Count);
conn.Close();
for (int i = 0; i <= Convert.ToInt32(Count) - 1; i++)
{
TextBox txtCtrl = (TextBox)Panel2.FindControl("txt" + (i + 1));
Label lblctrl = (Label)Panel2.FindControl("lbl" + (i + 1));
if (txtCtrl != null)
{
string s = txtCtrl.Text;
string s2 = lblctrl.Text;
string s1 = "Update ProductSpecification Set Value='"+s+"'Where Specification='"+s2+"'";
cmd = new OleDbCommand(s1, conn);
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
}
}
}
but it is givin error:
Syntax error in UPDATE statement.
plz help...
|
|
|
|
|
mylogics wrote: string s1 = "Update ProductSpecification Set Value='"+s+"'Where Specification='"+s2+"'";
Dear Friend
Please write you query with space between where cluase and single quote
string s1 = "Update ProductSpecification Set Value='"+s+"' Where Specification='"+s2+"'";
Be an Eagle, Sky is Yours.
|
|
|
|
|
i have written the query as u said but still givin same error...
|
|
|
|
|
If you passing text with single qoute like D'Souza then replace single quoute with ''.
Be an Eagle, Sky is Yours.
|
|
|
|
|
Hi sir i want to say my code is for text but i want 2 ask u how we use this code for date format.
|
|
|
|
|
Plz explain.
put you code here...
Be an Eagle, Sky is Yours.
|
|
|
|
|
your code is a disaster from start to finish. It has zero chance of working. You should rethink it, and perhaps do some study, so you have a basic idea of what you are doing. you should also read up on paramaterised queries, once your code is not totally useless, it will become totally insecure, due to SQL injection attacks. Once you fix that, it will also work for dates, as a side benefit.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Well, this has to be the most ridiculous code I've seen in a long time.
mylogics wrote: txt[i] = new TextBox();
txt[i].ID = "txt" + i.ToString();
string s1 = txt[i].Text;
string s2 = "Insert Into ProductSpecification(Value)Values('"+s1+"')";
Well, why would you expect s1 to be anything, but an empty string ? What on earth are you expecting here ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
i want to devlop a virtual tele phone which is acts like a normal phone using computer only.
in this we design a key board on the screen and when i press a number it goes to call .the number will be saved after .all of the application i want to done in ASP.Net .But i search in many sites it is not able to devlop TAPI (Telephony Appliacation Programming Inter face)in ASP.Net .
So i want to devlop TAPI in JAVA and then using that files how can implement virtual phone using ASP.Net application.
|
|
|
|
|
kareemmahammed wrote: So i want to devlop TAPI in JAVA and then using that f
This question has nothing to do with ASP.NET. I assume you want to write a java applet. In that case, if you use ASP.NET to write the page that holds the applet or not, is irrelevant to your overall goal.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
here is my code whenever i want to change the value of my dropdownlist i select only first value it can't
change to any other value. plz chk and reply
private void bounddropdownlist()
{
string query = "select CouponName,CouponTypeID from CouponType";
DAL Helper = new DAL();
Helper.ConnectionString = ConfigurationManager.AppSettings["ConnectionString"].ToString();
ds = new DataSet();
ds = Helper.ExecuteDataSet(CommandType.Text, query, null);
ddlCType.DataValueField = "CouponTypeID";
ddlCType.DataTextField = "CouponName";
ddlCType.DataSource = ds;
ddlCType.DataBind();
}
|
|
|
|
|
Well, again, your code really sucks. You need to abandon this project, and work on something more simple while you are just learning and cannot write commercial quality code. You seem to not know anything about ASP.NET and how it works yet.
haleemasher wrote: ddlCType.DataBind();
Every time you do this, the selected index is reset. I assume you call it in page load, and it therefore runs prior to your event, which is the problem.
haleemasher wrote: string query = "select CouponName,CouponTypeID from CouponType";
DAL Helper = new DAL();
Helper.ConnectionString = ConfigurationManager.AppSettings["ConnectionString"].ToString();
ds = new DataSet();
ds = Helper.ExecuteDataSet(CommandType.Text, query, null);
This is an absolute joke.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
u mean i will write
ddlCType.DataBind(); in page load or i write all my code in pageload????
|
|
|
|
|
I assume this method is being called by pageload now ? What is calling it ?
I am saying if you do this in page load, or any time prior to trying to access the selection, it will reset the selection. In fact, you should use IsPostback blocks to only load the data the first time, after that, it is in viewstate
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I think DataSet and DataTable are the most misused classes in .NET framework.
|
|
|
|