|
I have a list of PDF files which are uploaded into the database. Now on way back I recieve bytes which I Flush to browser but it ether ask for open or save option or it display nothing. Please help in any VB.Net or C# . My Code is
response.clear
response.contenttype="application/pdf"
response.flush
//tried either of below but both doesnt work
response.writebytes (myFileBytes)
// OR after writing a file from bytes
response.writefile(Filepath)
Response.end
Any help or suggestion ?
Regards
|
|
|
|
|
Rizwan Bashir wrote: but both doesnt work
Meaning?
|
|
|
|
|
Meaning it does not display in browser which is my problem.
|
|
|
|
|
If write file doesn't work, then you have serious issues. What's actually happening ? Try losing the clear and flush calls, you don't need them.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks Christain
It works with Firefox but does not work with IE 6.0.2x version. Any solutions for IE6 ?
Thanks Alot
|
|
|
|
|
I can't imagine why it wouldn't work, although I would use Response.BinaryWrite. Try that.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Same Story.. works with Firefox and does not work with IE6.. but surprisingly I tested it on IE7 and it works fine. I really dont know what is going on. Where i try on web with different pdf's available online they open directly in the IE 6 but not mine.
Regards
|
|
|
|
|
i have a table emp.where the coloumns are
emp_id,emp name and address.
and onother table named as emp_details
where the coloumns are.
empid,emp_sex,emp_age,emp_bloodgroup.
now i am populating the data of emp in the gridview1 where "auto generate select button is true".
whenever i will select the record of any employee.the corresponding empid of that column should display in the "textbox2" show that
i can enter the other data for emp_details(where the other text boxes are there to enter age,sex and blood_ group).
canyou tellme what code i wil write for it(in vb.net)
|
|
|
|
|
Loop through the all the Items in datagrid and Set the onclick attribute to the link button of grid, and then call any procedure through Javascript, which assigns the value to textbox.
Code for settting onclick attribute to datagrid.
Dim LnkBtn As New System.Web.UI.WebControls.LinkButton
LnkBtn = datagrid1.Items(i).Cells(0).FindControl("lnkSelect")
LnkBtn.Attributes.Add("onclick", "Write the Javascript Code Or Call local Javascript Procedure")
Script for Setting value to TextBox.
document.all('textbox1').value = datagrid1.Item(RowId).cells(ColID).text>
Bhaskar Shetty
|
|
|
|
|
hi guyz
again i need ur help.
i have a table emp.where the coloumns are
emp_id,emp name and address.
i am storing the data to "emp" table from the frontend throgh storepocedure.there is a "check" button, in which i want to check the data from the database based up on the empid.
i want to check if there is any record based up on the empid from emp table.it should give a message that "one reocrd found" .
where i am entering the empid in the "textbox1.text".what will be code for it in "vb.net"
|
|
|
|
|
In Stored Procedure,
"SELECT COUNT(*) FROM emp WHERE emp_id = @empID
Use SqlCommand or OledbCommand to execute the stored procedure. Get the return value and show it to the user.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
are u taking about how to execute sp in dotnet.
here code in C#
setting = ConfigurationManager.ConnectionStrings["databaseConnectionString"];
if (setting != null)
{
conn = new SqlConnection(setting.ConnectionString);
cmd = new SqlCommand("Sp_Category_check");
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@cateid", SqlDbType.VarChar);
cmd.Parameters["@cateid"].Value = DropDownList1.SelectedValue;
conn.Open();
cmd.Connection = conn;
try
{
rdr = cmd.ExecuteReader();
if (rdr.Read())
{
//here your message comes
}
}
catch (SqlException ex)
{
Response.Write(ex.ToString());
}
finally
{
if (rdr != null)
{
rdr.Close();
}
if (conn != null)
{
conn.Close();
}
}
imaran khan
|
|
|
|
|
Dear All,
I am trying to use the asp.net menu control in order to create a horizontal menu made up of images.
I have a table which has 3 columns and 1 row. the first cell is used to hold an image that does not have to do with the menu, the second cell holds a table that contains the menu while the third cell contains another independent image. All cellpadding and cellspacing and border are set to 0.
Now what is happening is that the menu cell is leaving a margin at the top of arount 1 or 2 pixels. All the images used in the row are the same height even the other images that do not have to do with the menu.
Everthing looks fine in mozilla! the problem is with IE
Anyone has ever encountered this?
Thanks a lot,
Chris Farrugia
|
|
|
|
|
Hi All,
Could anyone please help me out in auto-generating a property in a class in a following format:
public System.Int64 RollNumber
{
get
{
System.Int64 rollNo = (System.Int64 )this["@roll_number"];
return rollNo;
}
}
I am able to generate the property with the return statement and the other stuff, but i am not able to Generate the assignment statement i,e :
System.Int64 rollNo = (System.Int64 )this["@roll_number"];
Please Help.
Thanks,
Ramesh
|
|
|
|
|
I have created a user control that contains All Fields Like Address textbax
City Text box , State drop down ,zip code Textbox
Now State Drop downlist is another user control(different dll) that i am using into that
Now problem i am getting that on first page the drop down is prepopulating the All the list of states but after that is not can anyone tell What might be reasone ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hi friends
I want to know Which method is used in c# for InStr method which is used in VB.
VB Sample code
If Not InStr(1, Site.BarredFolders, Path.GetFileName(subdirectory), vbTextCompare) > 0 Then
Thanks In advance
Pathan
---------------------------------------------------
|
|
|
|
|
Imran Khan Pathan wrote: InStr
String.IndexOf() ??
Actually, there are methods like "str.Substring()" in C#. You have to do some experiments to get the result what you want.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Stuff like InStr is best avoided, if you're using VB.NET. Use the same stuff you'd use in C#.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
It's the IndexOf method on the string class.
However, be warned that result is 0-based while the legacy VB method is 1-based.
David Anton
http://www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
C++ to C# Converter: converts C++ to C#
C++ to VB Converter: converts C++ to VB
C++ to Java Converter: converts C++ to Java
Instant C++: converts C# to C++/CLI and VB to C++/CLI
|
|
|
|
|
Hi All,
I have used CodeDOM in .net to auto-generate C# code, which in essence generates a class file having a class along with its member fields, methods and properties.
However, i don know how to generate the following line of code:
private const string NAME = "CSharp";
Here, i have a generate a CodeMemberField which is a constant string with a private specifier as shown above.
Please send me the sample code which would help me to auto-generate the above line of code.
|
|
|
|
|
hi,
in my asp.net web application, I insert, update and delete records in an access database..I do that by creating a connection, an adaptor and so on everytime I wanna do any of these things...is there a better way to do these functions without doing this everytime. what's the best way to handle database transactions in my web application in order to make the application faster and optimize its performance??
|
|
|
|
|
Dear all,
I am using asp.net , C# , sql 2005.
I would like to present column wise detail(like gridview present row wise presentation). I manipulate my query to show three column per row (using cursor).
As my query is dynamic I decide at run time which field to show.
Please give me some idea like which web control I use to show column wise record in dynamic case.
Please guide me
thanks
imaran khan
|
|
|
|
|
Hi friends
what is sqldependency?
regards
saravan
|
|
|
|
|
|
I am storing images into database using serialization. while displaying those images into gridview control how to assign them to image button of gridview control?
|
|
|
|