|
Session is good if there is less data. As Session creates separately for each user. In your case this is fine if you are going to store few field in session.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I don't know what the recommended way to do this is but I have recently had the need to cloak values not so much in post backs but in page rendering.
For example I do not want anyone viewing the page source to see the id's of rendered components like buttons, divs etc and what to send back in the OnClientClick event.
What I have done is to generate GUID's and assign them to the ID of the web control, these are then checked against an array of the generated GUID's, responding to a button click returns a second GUID which is the matched to assigned web control in the array, this method completely masks the original value, in your case the client ID.
Note: Each time the page is loaded a new set of GUID's are generated..
I don't know if it can work for you but I think it might.
theLizard
|
|
|
|
|
Hi,
How can I filter two different datatables in a single datatable?
like consider I have following two datatables
DataTable A DataTable B
PID | CID CID | FID
1 | 1 1 | 1
2 | 2 4 | 8
4 | 16 16 | 32
So after filtering I can have a output like
DataTable C
PID | FID
1 | 1
4 | 32
So in my filtered dattable I can have only matching results of datatable A and Datatable C?
How can I do this using .Net datatable?
Rock Star
|
|
|
|
|
This isn't an ASP.NET question, its a database question. You're best bet would be to construct the query to return the results appropriately.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I think he is asking to manipulate Application end DataTable, not Database tables.
|
|
|
|
|
I realize he is asking for that but it would be more effecient to do it at the database level.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Ok... No big deal buddy..
|
|
|
|
|
You need to recreate the new DataTable.
Create Column using
<br />
DataTable.Columns.Add(new DataColumn()
To add a column
To add a new Row use
DataTable.NewRow()
then add the row as
DataTable.Rows.Add
|
|
|
|
|
But I want only matching column of datatable A and datatable B in datatable C
How can I do that?
Rock Star
|
|
|
|
|
Copy all DataTable to arrays, manipulate or filtering and create new DataTable
|
|
|
|
|
I was thinking of using select method. Is there any example for selecting data from two different datatables?
Rock Star
|
|
|
|
|
If you are using dotNetFramework 3.5 using Linq would be the easiest way
|
|
|
|
|
Use the SQL sentence:
SELECT A.PID,B.FID FROM A,B WHERE A.CID=B.CID,
write it in Visual Studio or Procedure
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 8:53am.
|
|
|
|
|
???Do you want to get a datatable??
StringBuilder strSQL= new StringBuilder("select A.* from A a inner join B on A.CID = B.CID");
SqlCommand cmd = new SqlCommand(strSQL.ToString(), conn, transaction);
DataTable C= new DataTable();
C.Load(cmd.ExecuteReader(), LoadOption.Upsert);
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 8:53am.
|
|
|
|
|
hi sir,
please help me.i am new in asp.net.
sir when i am using my web application on web it goes to log out suddenly.while it is working fine locally.
please suggest me what can be the issue.
and one more question sir my web application is very slow on web.but it working fast locally.
|
|
|
|
|
vikas shukla wrote: log out suddenly
Things don't happen suddenly and mysteriously, there is a cause of the action. Without knowing anything about your project, how it is coded, what you are doing, it is impossible to give any specific advice.
The speed difference can be attributed to the speed of your internet connection, the amount of data that is being transmitted, load on the server, and potentially several other factors
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi , I am using the following code to show the video stream in an image tag in aspx page.
It is working well in the firefox by showing the updated image from camera but it is not working
for Interner Explorer the image is not refreshed in the Internet Explorer what is the problem and how can it be resolved .The url for the image remains the same.
The code is :-
<title>
<asp:scriptmanager runat="server" enablepartialrendering="true" asyncpostbacktimeout="180">
<asp:timer id="timer" runat="server" interval="2" ontick="timer_Tick">
<asp:updatepanel id="upImage" runat="server" updatemode="Always">
<triggers>
<asp:asyncpostbacktrigger controlid="timer" eventname="Tick">
<contenttemplate>
<asp:image id="animatedImage" imageurl="http://IP Address of Camera/img/video.mjpeg" runat="server">
<asp:label id="test" runat="server">
|
|
|
|
|
Hi,
Am converting dataset to excel on button_Click using the below described code,
string attachment = "attachment; filename=Employee.xls";
Response.ClearContent();
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/ms-excel";
StringWriter stw = new StringWriter();
HtmlTextWriter htextw = new HtmlTextWriter(stw);
gvEmployee.RenderControl(htextw);
Response.Write(stw.ToString());
Response.End();
, after excel gets downloaded none of the other events get activated unless the page is refreshed.
How to download the excel in the same page retaining the controls in that page.
beula.
|
|
|
|
|
Hi,
with GemBox.Spreadsheet Excel C# library you can easily convert DataSet to Excel and stream it to browser.
Here is a code snippet how to do it:
var ef = new ExcelFile();
foreach (var dataTable in dataSet.Tables)
{
var ws = ef.Worksheets.Add(dataTable.TableName);
ws.InsertDataTable(dataTable, "A1", true);
}
Response.Clear();
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-Disposition", "attachment; filename=Employee.xls");
ef.SaveXls(Response.OutputStream);
Response.End();
|
|
|
|
|
Wich dataaccess metod is faster - with datareader when the data is return from stored procedures or with LINQ.
What is the difference if is working with milions of records in a table?
Thanks for your answers!
|
|
|
|
|
|
A properly used data reader will always be faster ... since it is of course the most direct method of accessing data in .NET. Data readers are even more efficient if you define indexes for the returned columns instead of using the string look-up method.
|
|
|
|
|
Do you how much faster it will be? Do you have any statistics for example table with 10 milin rows?
|
|
|
|
|
I have a system which I currently maintain that I converted one report from LINQ to the Data reader method. The one report was estimated to have a run time of a week with LINQ (we never let it finish just did timings on subsets) and the data reader version takes 30 seconds. Admittedly the LINQ version could have been cleaned up but LINQ encourages bad code so that needs to be watched for as well. In general
Data Readers with integer column indexes on well written stored procedures: fastest
Data Readers with string column indexes on well written stored procedures: 10x slower
LINQ 20x to 100x slower. Some situations LINQ will be just as fast as data readers but never faster.
You can ignore the size of the database for the discussion. If you want statistics there is someone who did a nice little timing comparison between all of the methods (you can search Google if you want) or you can take my word for it.
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: The one report was estimated to have a run time of a week with LINQ
That is possibly a little unfair, I've had 1st draft stored procs that have run times of hours, after a little works and some indexing they get reduced to seconds.
However your point that LINQ encourages lousy code by abstracting another layer is the telling point. How many devs get under the hood of the Linq, or are even capable of doing so!
I'm of the opinion that LINQ is one of the greatest abominations ever to come out of MS.
Never underestimate the power of human stupidity
RAH
|
|
|
|