For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
A user clicks the link but before the user is redirected to requestSummary.aspx page, user is prompted to login.
After a successful login, the user is then taken to that page.
The issue I am running into is that the querystring values that are passed to requestSummary.aspx are now empty.
To resolve this, I attempted to assign these values to session and passed the values back to the label controls.
This is not working as the controls are still blank.
This is what I have tried, just one example to show what I have tried:
'retrieve querystring values for hoursdiff:
'the markup - label control:
<td style="font-weight:bold"> Extra Hours: <asp:Label ID="lblhourspassedval" runat="server" /></td>
Dim intHours As Integer = 0
intHours = Request.QueryString("hoursdiff")
'Assign intHours to session:
Pass the session value back to the label control:
lblhourspassedval.Text = Session("intHours")
'Assign intHours to session:
Session("intHours") = intHours
You might also need to amend where you are setting the text value
if (Session("intHours) Is Not Nothing) then
lblhourspassedval.Text = Session("intHours").ToString
I don't know vb.net, the above is just a guess but I'm sure you can work it out.
The other issue you might be having is if you are always setting the session variable from the querystring and you visit the page when there is nothing in the querystring then your session variables will be cleared. You can check if the value you're looking for exists on the querystring using something like
if not string.IsNullOrWhiteSpace(Request.QueryString("yourvar")) then
I need to extract the last data so i used the following code in MVC controller:
var cmpid = db.complaint_master.Where(m => m.uid == id && m.isvalid == 0 && m.dateofcomplaint == date).Select(m => m.compid).LastOrDefault();
i am getting an error:
LINQ to Entities does not recognize the method 'Int32 LastOrDefault[Int32](System.Linq.IQueryable`1[System.Int32])' method, and this method cannot be translated into a store expression.
i want to develop a wcf service which will send encrypted message / response to client and client will decrypt it and same way client will send data in encrypted format which wcf service decrypt it before taking any action.
i hard that wcf has message inspector which can do it but not getting any easy understanding sample code to achieve the same. so please give me a sample code how to achieve it. also give me sample code for both wcf service and client side code.
please do not tell me to use certificate rather guide me what kind of code i need to write at service end and client to encrypt/decrypt data. please discuss here or redirect me to relevant article. thanks
<asp:SqlDataSourceID="MySqlDataSource1"runat="server"ConnectionString="<%$ ConnectionStrings:MyConnectionString %>"SelectCommand="SELECT * from myTable WHERE Active= 'True' AND myTable.Project = COALESCE(NULLIF(@FindProject, ''), myTable.Project)"CancelSelectOnNullParameter="False"><SelectParameters><asp:ControlParameterControlID="FindProject"Name="FindProject"PropertyName="Text"/></SelectParameters></asp:SqlDataSource>
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Im using MySql database and asp.net c#
I have a listview like this
<asp:Listview ID="listview1" runat="server">
<div class="header" >
<%# val("name ") %>
<%# val("pic ") %>
and its working now im struggling with paging .
i tried a datapager n i failed please help ...
which tool to use if i want to click a picture
from the listview and see full products details.
I am getting the following error when I try to run my ASP.Net web-forms application with my database credentials but I run the same application with my other colleagues database credentials I am not getting the error, then I thought may be my Db credentials are messed up then I tried to see if any difference exists in my authentication/authorization credentials, but I didn't find any difference between his credentials and my credentials. I am not understanding what could be the error and where am I missing, I am searching and trying to find the reason, but in this meantime if you know the solution please help me.
Here is my error on the VS crashing
Visual Studio Just-In-Time Debugger
An unhandled Microsoft .NET Framework exception occurred in w3wp.exe .
The Just-In-Time debugger was launched without necessary security permissions. To debug this process, the Just-In-Time debugger must be run as an Administrator. Would you like to debug this process?
[V] View process details [Yes, debug w3wp.exe] [No, cancel debugging]
Process Name: w3wp.exe
User Name: IIS APPPOOL\ELMS [Elevated]
And when I try to see it in the Windows log here it is
how can i please build graph has two part ( bi-part) , have like node friends facebook and posts facebook , link between two nodes( node friend and node post ) may be : like , comment and share ??
and how please can use library JoinJS to do it
thank you very much
here i am trying to save memory stream data into zip files which could be many segment. please see my below code which works fine.
privatevoid button2_Click(object sender, EventArgs e)
using (SqlConnection sqlConn = new SqlConnection(@"Data Source=BBATRIDIP\SQLSERVER2008R2;Initial Catalog=test;Integrated Security=True"))
string query = String.Format(@"SELECT [FilePath],[FileName],[FileData] FROM [TestTable]");
SqlCommand cmd = new SqlCommand(query, sqlConn);
System.IO.MemoryStream memStream = null;
ZipFile zip = new ZipFile();
zip.MaxOutputSegmentSize = 1024 * 1024; // 1MB each segment size would be
// the above line would split zip file into multiple files and each file
//size would be 1MB
using (SqlDataReader reader = cmd.ExecuteReader())
byte data = (byte)reader["FileData"];
memStream = new System.IO.MemoryStream(data);
string strFile = reader["FilePath"].ToString() + "\\" + reader["FileName"].ToString();
ZipEntry ze = zip.AddEntry(strFile, memStream);
// here u can save the zip in memory stream also there is a overload insteaa of saving in HD
i doubt the problem could be that approach stores the zip content in memory. Hence, when the zip content is huge, say exceeds 5 GB then then it crashes. so one guy said write to fileOutputStream mapped to physical file
guide me how to achieve to write to fileOutputStream mapped to physical file ?
see the below code because i doubt probably this way i may be able to write to fileOutputStream mapped to physical file here is the code
MemoryStream stream = new MemoryStream();
stream.Seek(0,SeekOrigin.Begin); // <-- must do this after writing the stream!
using (ZipFile zipFile = new ZipFile())
zipFile.AddEntry("Report.xml", "", stream);
Response.AppendHeader("content-disposition", "attachment; filename=Report.zip");
probably this line write to fileOutputStream mapped to physical file, just guide me am i on the right direction?
i have to call a web service which will supply large stream of data and i need to save that stream to zip file but zip will not be created at server side rather it will be created at client end. due to large stream of data i need to break the zip file into small segment say 500MB or 1GB. one after one segment will download at client side one by one. when first one will end then user will get a file save dialog to save second segment. when all segment will be completed at client side then client could extract all segment to get one folder which may have many files and sub folder.
just guide me with code sample or suggestion how to achieve it with best performance. i have some constraint like i could not save stream data in multiple segment zip file at server side first and then start the download all segment one by one. so please read my requirement and guide me how to achieve it with best performance for large data.
if anyone observe this line of code
byte data = (byte)reader["FileData"];
memStream = new System.IO.MemoryStream(data);
so i am storing something in memory stream first which is not good when data size would be huge. so guide me how could i achieve my task without using memory stream. rather directly i want to push the stream of data to dotnet zip library which will write each segment to OutputStream one by one.
The example you referenced shows how to load a file on the server into a memory stream, and then convert it to a zip or compressed file, and then package the file for download. Then it will prompt the browser to download the zip file.
The 2nd example on your reference shows a better way to write the code, the first example that you copied is the version that doesn't work very well, and has problems. Use the 2nd example.
But in hindsight, the codes function doesn't match what you want to do.
Could of swore that you want to upload the compressed file to the server.
So in button click, on the client machine, in the first code block where you read the file data from the database, you just read the reader, and get the bytes and store them in a buffer. Then close the database, exit the data function.
Now chop up the bytes into 4096 blocks or what ever value you choose.
So measure the byte buffer and get it's length, then divide the length by 4096, that's how many loops you need.
And then seek or start at 0, and grab 4096 chuck of bytes, then write the file, grad the next 4096 chunk of bytes, write the file and so on.
Make sure your files exist in a temp storage place like App_Data.
Get that working smooth first before you try to upload the files to the server.
I am using an asp.net application page to show the contents on the page with line break and OR image on the line break, I am not yet done with image itself, the problem is image appears at an inappropriate space or never appears as I have been trying with several options. Here I am putting this code that I am currently using. Can you please advice me or help me with any idea or code snippet or link any thing can be helpful, thank and your help is much appreciated as I am getting tired with this, searching on the internet no help so far but still trying.
CSS here, but with this the OR appears at the bottom and over the save and cancel buttons, which is not good and the numbers 1 and 2 appears over the first li's items, not useful and I don't why 1 appears only half, please help me if you can