|
getramonweb wrote: The expression cannot be evaluated while in design mode.
?sample("fsdf")
The expression cannot be evaluated while in run mode.
I created the following class with your method (your sample method would give compilation error) -
namespace MyNameSpace
{
public class MyClass
{
public static string sample(string s)
{
string k = s + "test";
return k;
}
}
}
Then I used the following commands in the immediate window to get the result (check that I used static method) -
?MyNameSpace.MyClass.sample("Arindam");
I think you need to read this[^] carefully. Mainly go through the multiple project section as you have to select the project as startup project. Also this link tells about some limitations.
|
|
|
|
|
thanks,, sorry for disturbing again and again
I just copy past the code ,but i got same error...can u plz guid me where i am going wrong
?MyNameSpace.MyClass.sample("Arindam");
The expression cannot be evaluated while in design mode.
Ramkumar
|
|
|
|
|
You are not disturbing anyone
It's my pleasure to solve (if any ) issues.
Did you select the project as startup project where you place this MyClass?
I have quoted the section from the MSDN[^]
Design Time Expression Evaluation in Multi-Project Solutions
When establishing the context for design time expression evaluation, Visual Studio references the currently selected project in Solution Explorer. If no project is selected in Solution Explorer, Visual Studio attempts to evaluate the function against the startup project. If the function cannot be evaluated in the current context, you will receive an error message. If you are attempting to evaluate a function in a project that is not the startup project for the solution and you receive an error, try selecting the project in Solution Explorer and attempt the evaluation again.
|
|
|
|
|
I am trying to show pie chart (asp.net VS2005) with dataset from oracle, below is the code given.
'ds' is the dataset here.
values from this dataset are in one row with multiple collumns.
so changing collumns to row with the help of datatable.
It gives error -->
"The chart ‘rds’ is in the report body but the report has no data set. Data regions are not allowed in reports without datasets"
error with line is -->
ReportViewer1.LocalReport.SetParameters(parameters);
//Code starts
ds = objdb.ByCursor("REPORTS_KURUKSHETRA.IDEA_STATISTICS", "" + "|" + "");
if (ds.Tables[0].Rows.Count > 0)
{
////FillPieChart();
DataSet nds = new DataSet();
DataTable ndt = new DataTable();
DataColumn ndc = new DataColumn("vals");
ndc.DataType = typeof(string);
ndt.Columns.Add(ndc);
for(int z =1; z < ds.Tables[0].Columns.Count; z++)
{
ndt.Rows.Add(" ");
ndt.Rows[z-1]["vals"] = ds.Tables[0].Rows[0][z].ToString();
}
ndt.AcceptChanges();
nds.Tables.Add(ndt);
ReportViewer1.LocalReport.ReportPath = "pie.rdlc";
Microsoft.Reporting.WebForms.ReportDataSource rds = new Microsoft.Reporting.WebForms.ReportDataSource();
rds.Name = "rds";
rds.Value = ndt;
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(rds);
ReportParameter prmTst = new ReportParameter("vals");
ReportParameter[] parameters = { prmTst };
ReportViewer1.LocalReport.SetParameters(parameters);
ReportViewer1.DataBind();
//ReportViewer1.LocalReport.Refresh();
}
//Code End
Please help, thanks in advance .
|
|
|
|
|
The type 'System.Web.UI.ScriptManager' is ambiguous: it could come from assembly 'C:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\
1.0.61025.0__31bf3856ad364e35\System.Web.Extensions.dll' or from
assembly 'C:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll'. Please specify the assembly explicitly in the type name.
i am getting the following error when m trying to use regular expression validator in my applicaton.i m workin on asp.net 2.0
using csharp....thnks.....plz guide......
|
|
|
|
|
If you are using Master page please add the script manager control in the master page and then try.
|
|
|
|
|
i m jst using using simple form.as soon as i use to add regular expression control this error comes...
|
|
|
|
|
I think there may be problem with your web config file . please send me the conf file.
|
|
|
|
|
i have mailed u config file
|
|
|
|
|
I dont know whether it is correct..
Please change the version as 2.0.0.0 and then try
"System.Web.Extensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
|
|
|
|
i hav tried its not workin....
|
|
|
|
|
i have list in which i have object of one class say emp
i want to find out all duplicate emp from list
meanse if two object with same emp.id
how can i do that
|
|
|
|
|
nikhil1234 wrote: how can i do that
Use List<> to store your employee and implement the following -
Distinct(IEqualityComparer<(Of <(T>)>))
You can use your own implementation of IEqualityComparer[^].
|
|
|
|
|
Dear Sir,
I am going to develop a program where I need live gold price.
i want international gold price per gm or any other unit.
how can i do this.
is there any web service available for live gold price.
please help me
syed abid ali
abidali_gyro@yahoo.co.in
thanks in advance
|
|
|
|
|
Did you check out the followings?
1.WebServiceX[^]
2.Xignite[^]
I guess there might be plenty if you google it. I just searched in google and got the above.
|
|
|
|
|
Hi syedabidali,
Refer the following link
http://www.goldalert.com/free-interactive-gold-charts/
|
|
|
|
|
|
Use upload control
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
Simi SA wrote: code of uploading a picture in ASP.NET?
welcome to Code Project,
This seems to be your first post in this forum....
Before posting better read http://www.codeproject.com/Messages/1278599/How-to-get-an-answer-to-your-question.aspx[^]
The code for your question is:
drag a fileupload from the toolbox and write the code as below....
protected void btnupload_Click(object sender, EventArgs e)
{
String savePath = Server.MapPath(@"your path\\");
if (FileUpload1.HasFile)
{
String fileName = FileUpload1.FileName;
savePath += fileName;
FileUpload1.SaveAs(savePath);
}
else
{
//your error message
}
}
|
|
|
|
|
Simi SA wrote: code of uploading a picture in ASP.NET?
Check here[^]
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hi all
I have a grid view which is used to delete the data in it. I want the data to be stored in another table before it is deleted from the actual table. The database is in Oracle. I am using the following code.
Sub GridView1_RowDeleting(ByVal sender As Object, ByVal e As GridViewDeleteEventArgs) Handles GridView1.RowDeleting
Dim oradb As String = "Data Source=(DESCRIPTION=" _
+ "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=Mahasilbkp.ltuisb.net)(PORT=1521)))" _
+ "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=db21a)));" _
+ "User Id=<userid>;Password=<password>;pooling=false;enlist=false;"
Dim conn1 As New OracleConnection(oradb)
conn1.Open()
Dim cmd1 As New OracleCommand
cmd1.Connection = conn1
GridView1.DataBind()
cmd1.CommandText = "insert into uu.record_backup(ntn, name, status, enf, aud, sector, delete_user) select ntn, name, status, enf, aud, sector" + ",'" + Label5.Text + "'" + " " + "from uu.total_cases where trim(ntn)=" + "'" + GridView1.SelectedValue + "'"
Dim dr1 As OracleDataReader = cmd1.ExecuteReader()
dr1.Read()
dr1.Dispose()
dr1.Close()
cmd1.Dispose()
conn1.Dispose()
conn1.Close()
End Sub
The insert command execute perfectly if I remove the GridView1.SelectedValue. But it does not give the desired result as I want the value displayed in the data grid to be inserted only, before it is deleted. What happens in the above code is that data is deleted from the actual table, but nothing is inserted in the backup table described in the code above. I understand I need to write something else instead of GridView1.SelectedValue, but I can't think of anything else. Please help me with this.
Thanks.
|
|
|
|
|
I think there may be some mistake in your query. Please refer Trigger concept to implement your desired results.
|
|
|
|
|
If there's mistake in query then how come it runs when i remove the GridView1.SelectedValue from it. I just need to get the value of the first column in the grid view. For that I need help. Thanks.
|
|
|
|
|
protected void grid_category_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
clsclass comfun = new clsclass(); // your main class or
sqlcommand cmd;
Label val = (Label)(your_grid.Rows[e.RowIndex].FindControl("lbl_id"));
comfun.ExecuteNonQuery("delete from evaluation_category where
evaluation_category_id=" + val.Text);
Label val1 = (Label)(your_grid.Rows[e.RowIndex].FindControl("lbl_1"));
Label val2 = (Label)(your_grid.Rows[e.RowIndex].FindControl("lbl_2"));
Label val2 = (Label)(your_grid.Rows[e.RowIndex].FindControl("lbl_3"));
cmd.executeNonQuery("insert into table values('"+ val1.text +','' + val2.text
+'',''+ val3.text+'")
// or done this query in storedprocedure
// or both query can be done in same procedure
// first remove value from first table then send thia to next one simple
FillGrid(); // bind your grid
}
Try this.
|
|
|
|
|
I tried your code and it's giving the following error
Object reference not set to an instance of an object.
It's coming in the line where I am using "val.text" in the insert statement.
|
|
|
|