|
It is in correct location means in the same folder and name space where global.asax is located.
The strange thing about it is, when I remove bin and obj folders, clean and rebuild the application, close the visual studio and reopen it again, and finally remove the application as application and then converting it back again as application. It runs good.
But I have to do all these steps whenever I change anything in the code. It is seeming mess for me all the time if I have to do it.
May be it something to do with its pdb files, is it because I have taken another web application changed its name and everything and then joined it into my solution. May be it is because of it? Please help me in making a permanent solution to it.
Every time doing the above steps may create more problems to my development time. Please any kind of help would help me a lot.
Thanks in advance.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
indian143 wrote: May be it something to do with its pdb files Most unlikely, since they are the project debug files used only by Visual Studio. It is much more likely that a path has been lost during a reorganisation or build of your files. There are a number of other reports of the same issues found by Google[^], which may help you.
|
|
|
|
|
It has so many different answers and trails and which are unsure of fixing the problem trying them all is taking more time. If there is any one who has got the similar problem, it would help me a lot.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
Thanks I have created whole ne project and added it to the solution. I think it is not being handled by IIS and Visual Studio properly. May be bug in either Visual Studio or IIS.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
I have done website in mvc3.in the form of controller and view. I want to use umbraco for content editing on my site.how i can achieve this.Can anybody help me.
|
|
|
|
|
|
I have a dynamically created grid view with a nested child grid view. On edit,I wanted to have different controls based on column data type so when I create template fields dynamically, I create user controls and add to grid view in edit Item template. grid view works fine with most of the data but with some special data when I want to edit a row, nothing happens and none of the buttons on the page works.
I used firebug to find out the error. I got the "Failed to load viewstate" error. Nothing is different with the other data that works fine but I don't know why some times edit doesn't work. I found out that if I remove a row from grid view edit works correctly!if the grid view row count is 16, I remove a row so with row count=15 it works. even when row count is 6 it works with 5. but as I said there isn't a rule and most of the time it works fine with any row count. Any one has idea what to do? Thank you.
|
|
|
|
|
could anyone please tell me how to implement radiobuttonlist with accordion style
|
|
|
|
|
Radiobuttonlist - consist of list of radiobuttons which can be used without creating a group name.
It may have many radiobutton but still it is a single control.so you cannot split it.
Try with RadioButton control
To learn all there is to know. I know I'll be disappointed one day, but I've made a good start, and the eventual disappointment is likely to be brief.
-Roger Wright
|
|
|
|
|
Dear All,
How can insert a data into SQL(MS SQL 2008 ) data base with apostrophe.
Please provide sample code to insert with a stored procedure from C#.Including all DB connectivity
Thanks,
Praveen Machat
|
|
|
|
|
|
You are creating the SQL query by concatenating strings, aren't you? That's very bad practise, and beyond the trouble with the apostrophes (and dates, and non-ASCII-characters, and ...), it invites SQL Injection attacks. Use a Parameterized Query instead.
|
|
|
|
|
As Bernhard said, using string concatenation to build a SQL query will leave your code vulnerable to SQL Injection[^].
You wanted sample code:
using (var connection = new SqlConnection("YourConnectionStringGoesHere"))
using (var command = new SqlCommand("YourProcedureNameGoesHere", connection))
{
command.CommandType = CommandType.StoredProcedure;
command.Parameters.AddWithValue("@YourParameterName", "This parameter value's got an embedded apostrophe.");
connection.Open();
command.ExecuteNonQuery();
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks you very much for advise ,
now I can insert apostrophe into database.
I have one more concern. If I am using above mentioned code,
How can I make class function to execute query.
Earlier I was passing a query(as string)to function, which will execute query. It gives flexibility to execute queries.
ie I could call function to execute any query.
Now, as parameters increases I need to create different query.
and I need to create separate code for deletion / updation / insertion.
Kindly provide a sample code to execute query as function as mentioned in above fashion
Thanks & Regards,
Praveen Machat
|
|
|
|
|
praveenmachat wrote: Kindly provide a sample code to execute query as function as mentioned in above fashion Just create a entity class with required fields like Name, Age, City. Assign values on UI layers & pass the class to this function.
public void execute(ClassEmployee objEmp)
using (var connection = new SqlConnection("YourConnectionStringGoesHere"))
using (var command = new SqlCommand("YourProcedureNameGoesHere", connection))
{
command.CommandType = CommandType.StoredProcedure;
command.Parameters.AddWithValue("@EmpName", objEmp.EmpName);
command.Parameters.AddWithValue("@EmpAge", objEmp.EmpAge);
command.Parameters.AddWithValue("@EmpCity", objEmp.EmpCity);
connection.Open();
command.ExecuteNonQuery();
}
} Check this article for reference
Creating ASP.NET Applications with N-Tier Architecture[^]
thatrajaCode converters | Education Needed
No thanks, I am all stocked up. - Luc Pattyn
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is - Henry Minute
|
|
|
|
|
Thank you for your kind response,
But my concern is ,how can i make function which will execute all queries.
otherwise for each query or Procedure in data base I need to create functions.
|
|
|
|
|
public static DataTable GetTable(SqlCommand cmd)
{
DataTable tbl = null;
SqlConnection conn = null;
try
{
conn =
cmd.Connection = conn;
tbl = new DataTable();
SqlDataReader dr = cmd.ExecuteReader();
tbl.Load(dr);
dr.Close();
dr.Dispose();
}
catch (Exception ex)
{
throw ex;
}
finally
{
if (conn != null)
{
conn.Close();
}
}
return tbl;
}
and in your main class you can call this function as
DataTable tbl = GetTable(cmd);
|
|
|
|
|
Can anyone give me a sample code to create multiple series dynamically and create a legend for all those series in asp.net chart control.
|
|
|
|
|
//design side:
<asp:chart id="yourchart" runat="server" Height="280px" Width="250px">
<titles>
<asp:Title ShadowOffset="3" Name="Title1" />
</titles>
<legends>
<asp:Legend Alignment="Center" Docking="Bottom" IsTextAutoFit="true" Name="Default" LegendStyle="Table" />
</legends>
<series>
<asp:Series Name="Default" /></series>
<chartareas>
<asp:ChartArea Name="ChartArea" BorderWidth="0" />
</chartareas>
</asp:chart>
yourchart.Series[0].XValueMember = "YourColumn";
yourchart.Series[0].YValueMembers = "YourColumn";
yourchart.Series["Default"].IsValueShownAsLabel = true;
yourchart.Series["Default"].ChartType = SeriesChartType.Pie;
yourchart.Series["Default"]["PieLabelStyle"] = "Disabled";
yourchart.ChartAreas["ChartArea"].Area3DStyle.Enable3D = false;
yourchart.Legends[0].Enabled = true;
LegendCellColumn LegendTextColumn = new LegendCellColumn();
LegendTextColumn.ColumnType = LegendCellColumnType.Text;
LegendTextColumn.Text = "#LEGENDTEXT";
yourchart.Legends["Default"].CellColumns.Add(LegendTextColumn);
|
|
|
|
|
I have some excel files on the server. When I am downloading them using asp.net, the downloaded excel file was corrupted. Below is my code. Could anyone tell me where I went wrong.
<pre lang="c#">
string filePath = Server.MapPath("docs\\sample.xls");
string filename = "sample";
HttpResponse res = HttpContext.Current.Response;
res.Clear();
res.AppendHeader("content-disposition", "attachment; filename=" + filename + ".xls");
res.ContentType = "application/octet-stream";
res.Write("<x:Name>" + filename + "</x:Name>");
res.WriteFile(filePath);
res.Flush();
res.End();
</pre>
|
|
|
|
|
Try changing your contentType to "application/vnd.ms-excel"
|
|
|
|
|
Kandepu Rajesh wrote: res.Write("<x:Name>" + filename + "</x:Name>"); That's the line that's causing the problem. You're adding a string to the start of a binary file, which is pretty-much guaranteed to corrupt it.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I know there is a million ways to do this. But what I want to happen is to have a spreadsheet/excel that computes for something say grades. The user using the browser (client-side) inputs some integers, the spreadsheet computes. When the user commits. The next time he/she views it from the browser. The changes is there. Please help. Thanks codeproject community!
|
|
|
|
|
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
please help me
|
|
|
|
|
You have an error in your connection string, but not being able to see it or the code surrounding it makes it impossible to say what it is.
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|