|
Get the data, stream it, save it as an .xls, connect to it with OleDb.
var question = (_2b || !(_2b));
|
|
|
|
|
|
Dear Friend,
I have created an project in which most of the time i use Try Catch block to catch error's syntax as follows
Try<br />
{<br />
}<br />
Catch(Exception ex)<br />
{<br />
throw new Exception(ex.message);<br />
}
But when any error occurred it give me message which is not user friendly, i want it in simple and understand manner, for that i think to create a class which will be business logic class between interface and Error handling Class (using inherit method), but for that i have to change the following code as User define code.
//Previous Code
Catch(Exception ex)<br />
{<br />
throw new Exception(ex.message);<br />
}<br />
//User Define Code
Catch(MyException ex)<br />
{<br />
throw new Exception(ex.message);<br />
}
which is time consuming, can it possible to create an class which does not required to change the code but still complete my requirement???
Thanks in advanced.
Sasmi
|
|
|
|
|
In the catch block,u can redirect to an error page. There u can receive the error and can display.This page can use for all the error throwing occations.Or u can display custom messages also.This is a good approach in error handling.
|
|
|
|
|
am using session and with that session id i want to populate textboxes in the page..am using stored procedure for it and data reader..am stuck as am not sure as how to populate the textboxes..do help..
thanks..
scarface
modified on Monday, March 9, 2009 8:21 AM
|
|
|
|
|
scar_face wrote: am using session and with that session id i want to populate textboxes in the page..am using stored procedure for it and data reader..am stuck as am not sure as how to populate the textboxes..do help..
I didn't get your actual problem. You want to retrieve data from Database based on SessionID or what ?
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
yes abhijit i would like to populate my textboxes based on the id taken from session..through that id am populating textboxes with the values from database..
scarface
|
|
|
|
|
I'm trying to work with anonymous identification, however the label is not displaying any AnonymousID
Label5.Text = Request.AnonymousID;
Default.aspx.cs
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Label5.Text = Request.AnonymousID;
}
protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
{
}
public void AnonymousIdentification_Creating(object sender,
AnonymousIDentificationEventArgs e)
{
e.AnonymousID = "Bubbles " + DateTime.Now;
}
protected void Button1_Click(object sender, EventArgs e)
{
if (Page.User.Identity.IsAuthenticated == true)
{
Profile.FirstName = txtFirstName.Text;
Profile.Surname = txtSurname.Text;
Profile.Age = txtAge.Text;
Profile.Member = DropDownList1.SelectedItem.Text;
Profile.LastVisited = DateTime.Now.ToString();
Label4.Text = "Stored information includes:<p>" + "First name: " + Profile.FirstName + "<br>Last name: " + Profile.Surname + "<br>Age: " + Profile.Age + "<br>Member: " + Profile.Member + "<br>Last visited: " + Profile.LastVisited;
}
else
{
Label4.Text = "You must be authenticated!";
}
}
}
web.config
----------
...
<anonymousidentification enabled="true" cookieless="AutoDetect" />
<profile>
<properties>
<add name="FirstName" />
<add name="Surname" />
<add name="LastVisited" allowanonymous="true" />
<add name="Age" />
<add name="Member" />
</properties>
</profile>
...
</br></br></br></br></p>
Error:
Error 1 The type or namespace name 'AnonymousIDentificationEventArgs' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Administrator\Documents\Visual Studio 2008\WebSites\TestWebSite\Default.aspx.cs 27 5 C:\...\TestWebSite\
Jon
|
|
|
|
|
A quick google tells me it lives in System.Web.Security. Google broken where you live ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
...
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
...
anything else?
Jon
|
|
|
|
|
I was commented my query, only 1 reply i got....than there is no further communcation for my question!!!!!
y is that, if any problem or u cant understand just feel free to ask, instead of disconnecting
Iam facing some problem in reading a excel sheet from server, how to make connection string.
My code.
String sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=http://justmypixels.com/escorts/sms/sms.xls; Extended Properties=Excel 8.0";
Iam getting the error " Invalid internet address "
What could be the DATA SOURCE ?????
Any good responsible person over there ?....pls feel free to help me
krishna
|
|
|
|
|
This is obviously not an ASP.ENT question - you're writing a client app that grabs an XLS over the web, right ? In that case, you need to write a web service to pass your file back, this has the advantage of allowing you to make your files secure.
If this is a website that tries to read an XLS file on the server, from a different website, well, that seems messed up to me, but I'd still look at a web service to serve the file. Ultimately, I'd just copy the file onto the server and be done with it, but why would a web page use an excel spreadsheet as a data source ? Can you even have concurrent users looking at a single XLS ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Just type
http://justmypixels.com/escorts/sms/sms.xls[^]
on your addressbar and press enter.. you will see the same error there too...
I think you must provide UNC path to the datasource(I didnt tried it with http path may be it is possible, i dont know though). Rather than going for internet address it would be simplier to download the excel to your server, or upload that file from the address to your server and then try connecting using UNC path.
Hope it helps
|
|
|
|
|
krishnavaradharajan wrote: escorts
just what kind of web site is this..
|
|
|
|
|
i wana do when edit button clicked the value of selected row is saved in table2 with remarks "before edit" and when click update button it update table1 and also make new entry in table2 with remarks "after edit"
prateek
prateekfgiet@gmail.com
modified on Monday, March 9, 2009 3:59 AM
|
|
|
|
|
...then what is your problem ?
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
i m able only make edit it will update the value of table which contain the material incoming detail,but anable to save before edit value and after edit value in second table(edit_val)
how cani do it
|
|
|
|
|
prateekfgiet wrote: ,but anable to save before edit value and after edit value in second table(edit_val)
Is this an audit table? You can write a trigger on the first table and insert the data into edit_val table from this trigger. Hook this trigger for all required events(insert,update and delete).
BTW, you need a spell checker first.
|
|
|
|
|
|
prateekfgiet wrote: i m able only make edit it will update the value of table which contain the material incoming detai
Good.
prateekfgiet wrote: but anable to save before edit value and after edit value in second table(edit_val)
What does it mean? I am still confused . Sorry.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
i m working on inventory managment project here when raw material come in store it creats entry in table1 reciept no.,name ,quantity and all that.
user can see all the entry by gridview if user makes any mistake he can mend it,but when he click edit button it creats a new entry in table2 with remarks "value before edit" and when user click update button it again make new entry in table2 with remarks "value after edit" and backgroundcolor of that perticuler row should be changed
|
|
|
|
|
Looks like you are new to CP. I recommend you to read the posting guidelines[^]. Read this[^] and learn to write quality questions. Now go and rephrase your question, so that we all can understand it.
|
|
|
|
|
ya i m new in CP but i m trying to explain to u
well i m working on inventory managment project here when raw material come in store it creats entry in table one reciept no.,name ,quantity and all that.
user can see all the entry by gridview if user makes any mistake he can mend it,but when he click edit button it creats a new entry in secon table with remarks "value before edit" and when user click update button it again make new entry in table2 with remarks "value after edit" and backgroundcolor of that perticuler row should be changed
|
|
|
|
|
Hi,
I can show my report (CR of VS 2005) well in my development machine (ASP.Net with C#). But after deploying in my sever, the toolbar images of the report is not displaying well. It show as red color (X) mark.
I googled and tried in different ways. But I could not solve it. I tried in four ways so far such as by pasting aspnet_client in my project folder, creating another virtual diretry in my prj and linking with aspnet_client, adding CR of VS2005 in pre-requisitis while building and finaly building with Merge module. But I never got help from the above mentioned 4 ways.
Anybody can help me? I'm being struck in this for more than 5 days.
Note: Report is generating well with toolbar images in my development machine in both of running the application and deploying the application.
Balasubramanian K.
|
|
|
|
|
can you paster code of the report (CR)? it's must request one data source, and (CR).rpt files must in one directory.
|
|
|
|