|
Got it!
I use the OnPreRender event of the submit button, at that time the controls UniqueID is already populated.
|
|
|
|
|
Hi
I have a website where I have tried to create a div with rounded corners but it is displaying as square corners, I took the idea from this webiste:
http://www.sitepoint.com/article/css-round-corners-boxes-curves
if anyone would know why this isnt working would be great
cheers!
|
|
|
|
|
.netman wrote: if anyone would know why this isnt working would be great
You're kidding right?
led mike
|
|
|
|
|
Dear All,
I have problem in getting number of pages in report that displayed ,I have done alot of search... I am using Crystal Reports 11
and asp.net 1.1
CrystalDecisions.CrystalReports.Engine.FieldObject fd;
// fd = rpt.ReportFooterSection1.ReportObjects["PageNofM"] as CrystalDecisions.CrystalReports.Engine.FieldObject;
fd = rpt.PageFooterSection1.ReportObjects[0] as CrystalDecisions.CrystalReports.Engine.FieldObject;
string jx=fd.DataSource.Name.ToString ();
AND by theWay I want to creating paging in report bcz the navigation toolbar dont display in FireFox or operah,,,If any one can know how i can display it wil bbeee very good
Regard
,
Yes. CreatiVity withOuT limiTs
|
|
|
|
|
Amr M. K. wrote: urgent
Words like 'urgent' does not help in discussion forums. If it is really urgent, you ought to seek a paid support channel. Trying to preempt support in a discussion forum unethically by using such phrases really makes you look and sound rude.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Hi
I have the following code:
<div id="Div1" style=" height:600px; border-width:6px; border-color:Black; border:2px; background-image:url(picture1.jpeg);" runat="server">
</div>
I have set the div background an image but it isnt showing anything, is there something wrong with the syntax above?
cheers!
|
|
|
|
|
no it is true but maybe url is incorrect
check the "picture1.jpeg"
|
|
|
|
|
thanks for the reply, i changed it to jpg and it worked!
cheers!
|
|
|
|
|
I am working on a aspx page that allows a user to change the look and feel(like iGoogle). I want to save each users profile into an XML file.
Can anyone please help!
Thanks in advance!
|
|
|
|
|
|
Cool man, thanks and shame on me but ya thanks for your help
|
|
|
|
|
You are welcome! and I'm sorry for being a bit grumpy, my day sucks today
Btw, I think you really should try that profile provider mentioned, it is better than plain XML file read/write access and it is also integrated into you object model, in your code you can access your Profile properties directly.
http://msdn.microsoft.com/en-us/library/system.web.profile.profilebase.aspx[^]
|
|
|
|
|
hello every buddy
i am creating and deleting folder in my site.
but my problem is that when ever i delete folder then it work only in Mozilla Firefox not in IE. and 2nt problem is that after deleting folder it logout me like i build the project.
my code for delete folder is below-
string folderpath = HttpContext.Current.Server.MapPath("folder path");
System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(folderpath);
if (di.Exists)
{
di.Delete(true);
}
Rajeev Kr. Sharma
VRI Software Pvt.Ltd.
New Delhi India
HumOnline.com
Stay Connected
|
|
|
|
|
did you mean folder delete only at the Mozila ??????????
|
|
|
|
|
yes
Rajeev Kr. Sharma
VRI Software Pvt.Ltd.
New Delhi India
HumOnline.com
Stay Connected
|
|
|
|
|
so so intersting because i think it is server side code and not depend on the browser
|
|
|
|
|
i am also surprise.
Rajeev Kr. Sharma
VRI Software Pvt.Ltd.
New Delhi India
HumOnline.com
Stay Connected
|
|
|
|
|
The submitted data should also be examined if there is a faulty escaped (encoding).
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Hi all,
this error occure in my function:not all code paths return a value
public bool ValidateNewUser(string strAlias, string strFirst, string strLast)
{
SqlConnection MyConn = new SqlConnection(ConfigurationSettings.AppSettings["MyOnlineShoppingConnectionString2"]);
SqlCommand MyCmd = new SqlCommand("sp_CheckForDuplicates", MyConn);
MyCmd.CommandType = CommandType.StoredProcedure;
SqlParameter objParam1;
SqlParameter objParam2;
SqlParameter objParam3;
SqlParameter objReturnParam;
objParam1 = MyCmd.Parameters.Add("@UserName", SqlDbType.VarChar);
objParam2 = MyCmd.Parameters.Add("@FirstName", SqlDbType.VarChar);
objParam3 = MyCmd.Parameters.Add("@LastName", SqlDbType.VarChar);
objReturnParam = MyCmd.Parameters.Add("@Duplicates", SqlDbType.Int);
objReturnParam.Direction = ParameterDirection.ReturnValue;
objParam1.Value = strAlias;
objParam2.Value = strFirst;
objParam3.Value = strLast;
try
{
if (MyConn.State == ConnectionState.Closed)
{
MyConn.Open();
MyCmd.ExecuteNonQuery();
}
if (Convert.ToInt32(objReturnParam.Value )>0)
{
lblResult.Text = "UserName already exists or you are already a registered user!";
return false;
}
else
{
return true;
}
MyConn.Close();
}
catch (Exception ex)
{
lblError.Text = "Error Connecting to Database!";
}
}
i have two return value but how i can define these for all function?
Thank You,
Hoda
|
|
|
|
|
public bool ValidateNewUser(string strAlias, string strFirst, string strLast)
so you must return a value in the all way
add "return false" to the end of function or remove the else
if (Convert.ToInt32(objReturnParam.Value )>0)
{
lblResult.Text = "UserName already exists or you are already a registered user!";
return false;
}
return true;
|
|
|
|
|
First, be sure you close the connection all the time, in your code, the line MyConn.Close(); is never called!
And the reason for the error is, that you don't return anything when there is an exception. you need to have a return statement in your catch block, however, cleaner solution would be to have a finally block after catch, where you return a value
|
|
|
|
|
I created a form view in asp.net for a data entry web page. User inputs data which is supposed to get inserted into my MySql database in a existing database. but when I try the following code, I get the following error:
System.Data.Odbc.OdbcException: ERROR [42000] [MySQL][ODBC 5.1 Driver][mysqld-5.0.45-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'product_id, 'Button Up'product_name, 'shirts'product_desc, 1000tot_qty, 36tot_ca' at line 2
This is the script I am running in my .aspx file.
InsertCommand="insert into product(product_id, product_name, product_desc, tot_qty, tot_cartons, cost, tot_colors,qty_per_carton, arrival_date, custom_clearedby, ship_mode)
values( ?product_id, ?product_name, ?product_desc, ?tot_qty, ?tot_cartons, ?cost, ?tot_colors,?qty_per_carton, ?arrival_date, ?custom_clearedby, ?ship_mode);
I would really appreciate any help/insight.
Thanks in advance
modified on Monday, May 19, 2008 12:17 PM
|
|
|
|
|
When trouble shooting commands like this, it always helps to show all of the relevant code (e.g. paramaters).
Each paramater "?some_param" should be assigned a value, you did not post this part of the code. Also, the paramaters should be added in the same order they are used in you MySql statement. I also don't see you closing the string, however this might be a copy/paste typo. Nonetheless, complete code is essential especially when this appears to be some type of string problem.
Based on your posted example, they should look like this:
mysqlCmd.Parameters.AddWithValue("?product_id", "some_value")
mysqlCmd.Parameters.AddWithValue("?product_name", "some_value")
mysqlCmd.Parameters.AddWithValue("?product_desc", "some_value")
etc..
Hope this helps!
|
|
|
|
|
I want to Format a value in report..Iam using component designer as report tool..
xmlDoc.Load(strPath & "/Reports/Analysis Reports/ReservedItemsSummary.xml")
xmlDoc.GetElementsByTagName("pssl_unitprice").Item(0).InnerXml.Format = "#,##0.000"
this syntax is wrong..
can any one help how to format the value of field(pssl_unitprice) from xml file...
I want to format the value 0.000 format
|
|
|
|
|
Hi,
I made a class file , which is being used to interact with the database.
Can i get ur views to improve it.
I m doing all the rollback /commit transaction at the stored procedure level.
According to me this is my Best code ever written in my carrier.
Here is the code.....
using System;<br />
using System.Data;<br />
using System.Configuration;<br />
using System.Web;<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Web.UI.HtmlControls;<br />
using System.Data.SqlClient;<br />
<br />
namespace MyClasses<br />
{<br />
public class AddParameters<br />
{ <br />
public AddParameters[] p;<br />
internal SqlParameter param = new SqlParameter();<br />
public AddParameters()<br />
{<br />
p = new AddParameters[1];<br />
}<br />
public void ParameterFunction<T>(string ParameterName, T _ParameterValue, ParameterDirection ParameterDirection, SqlDbType ParameterType)<br />
{<br />
if (p[p.Length - 1] != null)<br />
{<br />
AddParameters[] temp = new AddParameters[p.Length];<br />
p.CopyTo(temp, 0);<br />
p = new AddParameters[p.Length + 1];<br />
for (int i = 0; i < p.Length - 1; i++)<br />
{<br />
p[i] = temp[i];<br />
}<br />
p[p.Length - 1] = new AddParameters();<br />
p[p.Length - 1].param.ParameterName = ParameterName;<br />
p[p.Length - 1].param.Value = _ParameterValue;<br />
p[p.Length - 1].param.Direction = ParameterDirection;<br />
p[p.Length - 1].param.SqlDbType = ParameterType;<br />
}<br />
else<br />
{<br />
p[0] = new AddParameters();<br />
p[0].param.ParameterName = ParameterName;<br />
p[0].param.SqlValue = _ParameterValue;<br />
p[0].param.Direction = ParameterDirection;<br />
p[0].param.SqlDbType = ParameterType;<br />
}<br />
}<br />
}<br />
<br />
public class DatabaseInteraction
{<br />
AddParameters ad = null;<br />
SqlConnection con = null;<br />
private string connectionstring = "";<br />
private string StoredProcedure = "";<br />
SqlCommand cmd = null;<br />
DataSet ds = null;<br />
SqlDataAdapter sqlad = null;<br />
public void AddParameters<T>(string Parametername, T Parametervalue, ParameterDirection ParameterDirection, SqlDbType type)<br />
{<br />
}<br />
public DatabaseInteraction()<br />
{<br />
<br />
}<br />
public static string ChangeDateFormat(string t)<br />
{<br />
string dat = "";<br />
DateTime datformat;<br />
if (DateTime.TryParse(t, out datformat))<br />
{<br />
dat = datformat.ToString("dd/MM/yyyy");<br />
return dat;<br />
}<br />
return dat;<br />
}<br />
public DatabaseInteraction(string constr)<br />
{<br />
connectionstring = constr;<br />
ad = new AddParameters();<br />
} <br />
<br />
private string Connect(out SqlConnection con)<br />
{<br />
try<br />
{<br />
con = new SqlConnection(connectionstring);<br />
con.Open();<br />
return "";<br />
}<br />
<br />
catch (Exception ex)<br />
{<br />
con = null;<br />
return ex.Message.ToString();<br />
}<br />
}<br />
<br />
public string StoredProcedureName<br />
{ <br />
get<br />
{<br />
return StoredProcedure;<br />
}<br />
set<br />
{<br />
StoredProcedure = value;<br />
}<br />
}<br />
public string BindingWithControl(Control ctl, string ValueMember, string DisplayMember)<br />
{<br />
string message = Connect(out con);<br />
if (message == "")<br />
{<br />
message = GetDataSet(con, ref ds);<br />
if (message == "")<br />
{<br />
BindControl(ctl, ds, DisplayMember, ValueMember);<br />
con.Close();<br />
return "";<br />
}<br />
else<br />
{<br />
con.Close();<br />
return message;<br />
}<br />
}<br />
else<br />
{<br />
con.Close();<br />
return message;<br />
}<br />
}<br />
<br />
public void BindControl(Control ctl, DataSet ds, string DisplayMember, string ValueMember)<br />
{<br />
if (ctl is RadioButtonList)<br />
{<br />
RadioButtonList chk;<br />
chk = (RadioButtonList)ctl;<br />
chk.DataTextField = DisplayMember;<br />
chk.DataValueField = ValueMember;<br />
chk.DataSource = ds.Tables[0];<br />
chk.DataBind();<br />
}<br />
if (ctl is CheckBoxList)<br />
{<br />
CheckBoxList chk;<br />
chk = (CheckBoxList)ctl;<br />
chk.DataTextField = DisplayMember;<br />
chk.DataValueField = ValueMember;<br />
chk.DataSource = ds.Tables[0];<br />
chk.DataBind();<br />
}<br />
if (ctl is DropDownList)<br />
{<br />
DropDownList ddl;<br />
ddl = (DropDownList)ctl;<br />
if (DisplayMember != "")<br />
{<br />
ddl.DataTextField = DisplayMember;<br />
}<br />
if (ValueMember != "")<br />
{<br />
ddl.DataValueField = ValueMember;<br />
} <br />
ddl.DataSource = ds;<br />
ddl.DataBind();<br />
}<br />
if (ctl is GridView)<br />
{<br />
GridView gv;<br />
gv = (GridView)ctl;<br />
if (ds.Tables.Count == 0)<br />
{<br />
return;<br />
}<br />
gv.ID = ctl.ID;<br />
gv.DataSource = ds;<br />
gv.DataBind();<br />
}<br />
if (ctl is Repeater)<br />
{<br />
Repeater gv;<br />
gv = (Repeater)ctl;<br />
if (ds.Tables.Count == 0)<br />
{<br />
return;<br />
}<br />
gv.ID = ctl.ID;<br />
gv.DataSource = ds;<br />
gv.DataBind();<br />
}<br />
if (ctl is DataList)<br />
{<br />
DataList gv;<br />
gv = (DataList)ctl;<br />
if (ds.Tables.Count == 0)<br />
{<br />
return;<br />
}<br />
gv.ID = ctl.ID;<br />
gv.DataSource = ds;<br />
gv.DataBind();<br />
}<br />
}<br />
<br />
public string GetDataSet(SqlConnection con, ref DataSet ds)<br />
{<br />
try<br />
{<br />
<br />
cmd = new SqlCommand();<br />
cmd.Connection = con;<br />
cmd.CommandType = CommandType.StoredProcedure;<br />
cmd.CommandText = StoredProcedure;<br />
if (ad != null)<br />
{<br />
if (ad.p[0] != null)<br />
{<br />
if (ad.p.Length != 0)<br />
ReturnSqlCommand(ref cmd, ad.p);<br />
}<br />
}<br />
ds = new DataSet();<br />
<br />
sqlad = new SqlDataAdapter(cmd);<br />
sqlad.Fill(ds);<br />
if (ad.p[0] == null)<br />
{<br />
return "";<br />
}<br />
for (int count = 0; count < ad.p.Length; count++)<br />
{<br />
if (ad.p[count] == null)<br />
continue;<br />
if (ad.p[count].param.Direction == ParameterDirection.Output)<br />
{<br />
ad.p[count].param.SqlValue = cmd.Parameters[count].Value.ToString();<br />
}<br />
if (ad.p[count].param.Direction == ParameterDirection.InputOutput)<br />
{<br />
ad.p[count].param.SqlValue = cmd.Parameters[count].Value.ToString();<br />
}<br />
} <br />
return "";<br />
}<br />
catch (Exception ex)<br />
{<br />
return ex.Message.ToString(); <br />
}<br />
}<br />
<br />
private SqlCommand ReturnSqlCommand(ref SqlCommand cmd, AddParameters[] db)<br />
{<br />
for (int count = 0; count < db.Length; count++)<br />
{<br />
if (db[count].param.Direction == ParameterDirection.Input)<br />
{<br />
cmd.Parameters.AddWithValue(db[count].param.ParameterName, db[count].param.SqlDbType).Value = db[count].param.SqlValue;<br />
cmd.Parameters[count].SqlDbType = db[count].param.SqlDbType;<br />
}<br />
if (db[count].param.Direction == ParameterDirection.Output)<br />
{<br />
cmd.Parameters.AddWithValue(db[count].param.ParameterName, db[count].param.SqlDbType);<br />
cmd.Parameters[count].SqlDbType = db[count].param.SqlDbType;<br />
cmd.Parameters[count].Direction = ParameterDirection.Output;<br />
}<br />
if (db[count].param.Direction == ParameterDirection.InputOutput)<br />
{<br />
cmd.Parameters.AddWithValue(db[count].param.ParameterName, db[count].param.SqlDbType);<br />
cmd.Parameters[count].SqlDbType = db[count].param.SqlDbType;<br />
cmd.Parameters[count].Direction = ParameterDirection.InputOutput;<br />
cmd.Parameters[count].Size = 3000;<br />
}<br />
}<br />
return cmd;<br />
}<br />
<br />
public string returnScalarData()<br />
{<br />
SqlCommand cmd = new SqlCommand();<br />
SqlConnection con;<br />
Connect(out con);<br />
DataSet ds = new DataSet();<br />
cmd.Connection = con;<br />
cmd.CommandType = CommandType.StoredProcedure;<br />
cmd.CommandText = StoredProcedure;<br />
if (ad != null)<br />
{<br />
if (ad.p != null)<br />
{<br />
if (ad.p.Length != 0)<br />
ReturnSqlCommand(ref cmd, ad.p);<br />
}<br />
<br />
}<br />
if (cmd.ExecuteScalar() == null)<br />
return null;<br />
else<br />
return cmd.ExecuteScalar().ToString().Trim();<br />
}<br />
<br />
public DataSet returndataset()<br />
{<br />
SqlCommand cmd = new SqlCommand();<br />
SqlConnection con;<br />
Connect(out con);<br />
DataSet ds = new DataSet();<br />
cmd.Connection = con;<br />
cmd.CommandType = CommandType.StoredProcedure;<br />
cmd.CommandText = StoredProcedure;<br />
if (ad != null)<br />
{<br />
if (ad.p[0] != null)<br />
{<br />
if (ad.p.Length != 0)<br />
ReturnSqlCommand(ref cmd, ad.p);<br />
}<br />
}<br />
sqlad = new SqlDataAdapter(cmd);<br />
sqlad.Fill(ds);<br />
sqlad = null;<br />
return ds;<br />
}<br />
}<br />
}
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|