|
tried
zip.Addfile("export.xls","content");
getting this error
C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\Employee.xls
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\Employee.xls
|
|
|
|
|
Member 3222264 wrote: tried
That was the part that seemed to be used to add files to the zip-archive. An empty list of files will result in an empty archive.
Member 3222264 wrote: getting this error
Check if the file below exists;
C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\Employee.xls
If the file doesn't exist, then it won't be added to the archive. Make sure you call the code that creates the Excell-file before adding it to the list.
I are Troll
|
|
|
|
|
while exporting to excel how the file will be in this path
the below works fine to export it as excel
HtmlForm form = new HtmlForm();
string attachment = "attachment; filename=Employee.xls";
Response.ClearContent();
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/ms-excel";
System.IO.StringWriter stw = new System.IO.StringWriter();
HtmlTextWriter htextw = new HtmlTextWriter(stw);
form.Controls.Add(grd);
this.Controls.Add(form);
form.RenderControl(htextw);
Response.Write(stw.ToString());
Response.End();
but i do not know why the Employee.xls is not attached to excel
Do u have sample code to zip the file and export?
|
|
|
|
|
Member 3222264 wrote: but i do not know why the Employee.xls is not attached to excel
Well, the above code doesn't generate a file on disk. And that's what the code that's doing the zipping is expecting.
Member 3222264 wrote: while exporting to excel how the file will be in this path
What data is in that streamwriter? ..and what happens if you write that data to a file?
I are Troll
|
|
|
|
|
Please read the forum guidelines and use pre tags when posting code.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
in crystal report whatever i am sending through dataset, all the columns of the database it is displaying in crystal report but only date column field is not binding. It is not getting value. but in dataset the date column has a value. Reply . Thanks in advance.
|
|
|
|
|
using mysql select query, i am sending dataset to crystal report and i am getting the result. But i want get only one row for particular ID. We are making 3 or more times transaction. So 3 rows is coming. For taking only one row, how to write formula in total field in crystal report so that it will add all those amount for that particular id and display only one row with the sum of that amount. thanks in advance.
|
|
|
|
|
Hi,
In winforms or wpf application, lets say there is one container control which adds controllers dynamically and it also adds event handlers of that child controls.
Now if I call a clear method of the parent container control, will the event handlers added be removed automatically?
If not and I dont remove them (event handlers), will it create any other issue?
Please suggest!
Thanks,
Divyesh
|
|
|
|
|
when you clear a container control, it disposes of all the contained controls; each control will be available for garbage collection, and the event members they contain will have no influence, just like any other data members. There is no need to remove handlers at all.
BTW: The same applies to a modeless form that gets closed.
|
|
|
|
|
Hi
Is there a way of installing other software such as MySQL in a setup project. If so is it also possible to execute a script to create a database?
Thanks
|
|
|
|
|
|
In C#2.0,the Codedom library how to generate the method of foreach?
|
|
|
|
|
A foreach is actually a convenience wrapper around a loop with an enumerator. That's what you need to enumerate over. Try to create a CodeDOM for this instead:
IEnumerator e = item.GetEnumerator();
while(e.MoveNext())
{
myList.Add(ConvertToObject(item));
}
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi,
I have an application in C# that use SQL Server 2008 R2 Express.
When i install the package i need to choose option and to install:
1. Microsoft .Net Framework 3.5 SP1.
2. Windows Installer 4.5.
3. Windows PowerShell 1.0
I have an SQL Script that will build my DB at SQL 2008 R2 Express and will add the user configuration that i want.
I want to make install package that will include the SQL 2008 R2 Express (including "Microsoft .Net Framework 3.5 SP1.",
,"Windows Installer 4.5" and "Windows PowerShell 1.0 ").
Will run the script and install my application.
I don't want to let the user to choose configuration for the DB in the installation process.
How can i do that?
Thanks,
Shai.
|
|
|
|
|
|
Guys;
I used system.drawing.Image to get a MetaFile, the type is an EMF file:
Image img= new Metafile(new System.IO.MemoryStream(), HDC,rc, MetafileFrameUnit.Pixel, EmfType.EmfOnly);
After an EMF file is created. I need to convert it to Bitmap, using: img.Save(sTempfilename, ImageFormat.bmp); Its background becomes black. I think i can not save directly since the format is different.
Would you give some suggestions on how to convert the EMF image to a Bitmap? Thanks very much.
|
|
|
|
|
|
Thanks a lot!
|
|
|
|
|
My Pleasure.
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Do you want to develop Rich Internet Applications for the enterprise? Do you want to know how Flex integrates with enterprise services using LiveCycle DS/BlazeDS? Anne Kathrine Petteroe will be in Bangalore this August to explain how you can use Adobe's Flash Platform to develop Rich Internet Applications for the enterprise. It will starts with discussing the typical challenges of enterprise application development and why choosing the right UI strategy is important. This part also covers architectural considerations. Next, see how Flex integrates with enterprise services using LiveCycle DS/BlazeDS or Web Services. At Adobe Flash Platform Summit 2010, to be held 25-26 August, Anne will also give examples and experiences from integrating with SAP back-end.
Anne Kathrine Petteroe is an Enterprise Platform Evangelist at Adobe. Before joining Adobe she was a SAP consultant with focus on UI development and strategy, as well as RIAs, Flex and form design. She is also the co-lead of ESME, an open source micromessaging platform for the enterprise.
Attend AFPS 2010 for the sheer value of the content! No other conference in India offers such a comprehensive mix of technical and creative content, delivered by the industry's leading speakers and platform experts. Across two days, you have access to over forty presentations including inspiring keynotes from legendary Adobe speakers. You also have the opportunity to hang out at the expo area and connect with Adobe partners, industry leaders and peer developers and designers. With over 2000 attendees sharing the same passion as you, imagine the opportunities to network and further your goals.
Need more reasons? As the single, largest Flash Platform conference in India, at AFPS you get to hear about stuff in the roadmap and future directions before anyone else. Some of the specific highlights include: deep dive sessions around the latest product releases in the Adobe Flash Platform including exciting recent developments like Flash on devices, and targeted sessions for newcomers to the platform as well. For more information, visit: www.adobesummit.com
AFPS 2010 is homespun by Saltmarch Media, producers of Great Indian Developer Summit and Developer March – India’s biggest and independent polyglot conference and portal for software developers.
A Saltmarch Media
E: info@saltmarch.com
Ph: +91 80 4005 1000
|
|
|
|
|
shankarjain2010 wrote: As the single, largest Flash Platform conference in India
You really are a grade A, full blown, moron of the highest order. First of all, this is advertising, so you shouldn't be posting it in the forums - secondly, and this proves you are a wlueless canker, what has this got to do with .NET?
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
hi dude,
Please read this[^] guideline before you post anything in the thread.
Please do not market your product, Website or yourself in discussion forum. There are other sites which
allows you to do that, this is question answer forum.
You can tell some marketing company they will market your product or site. Like if you can tell google
then google will market according to your way but you need to pay for that.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
I am using a stored procedure to insert data into two tables in sql 2008 server. Now while handling exception I am using exception code to check the exception and accordingly i am showing the error message to the user.Can u tell me a better option to do the same.
Public Sub rtrnQry(ByVal usrNm As String, ByVal psWd As String, ByVal fNm As String, _
ByVal lNm As String, ByVal empId As Integer, ByVal proNm As String, ByVal aDm As String, ByVal rowno As Integer)
Try
Using cn As New SqlConnection(sqlConnStr)
cn.Open()
Using cmd As New SqlCommand("InsrtLogin", cn)
With cmd
.CommandType = CommandType.StoredProcedure
.Parameters.AddWithValue("@empid", empId)
.Parameters.AddWithValue("@username", usrNm)
.Parameters.AddWithValue("@password", psWd)
.Parameters.AddWithValue("@firstname", fNm)
.Parameters.AddWithValue("@lastname", lNm)
.Parameters.AddWithValue("@adminpri", aDm)
.Parameters.AddWithValue("@proName", proNm)
.ExecuteNonQuery()
End With
End Using
End Using
Catch ex As SqlException
If chkBox1_Crtusr.Checked Then
If ex.Number.Equals(2627) Then 'Exception code for Primary Key Violation
MsgBox("Duplicate Employee ID cannot be inserted. Violation of Primary Key " & _
"Constraint Occured. Enter an unique value.Please check row number : 1", MsgBoxStyle.Critical, "Error")
Else
MsgBox(ex.ToString)
End If
If ex.Number.Equals(208) Then
MsgBox("Invalid Table Name. Check the Sql String.", MsgBoxStyle.Critical, "Error")
End If
End If
If chkBox2_Crtusr.Checked Then
If ex.Number.Equals(2627) Then 'Exception code for Primary Key Violation
MsgBox("Duplicate Employee ID cannot be inserted. Violation of Primary Key " & _
"Constraint Occured. Enter an unique value.Please check row number : 2", MsgBoxStyle.Critical, "Error")
Else
MsgBox(ex.ToString)
End If
If ex.Number.Equals(208) Then
MsgBox("Invalid Table Name. Check the Sql String.", MsgBoxStyle.Critical, "Error")
End If
Now I am calling the above procedure
Private Sub btnSubmit_CrtMul_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit_CrtMul.Click
Dim cnt As Integer = 0
Try
If chkBox1_Crtusr.Checked Then
rtrnQry(txtUsrNm_1.Text, txtPswd_1.Text, txtFName_1.Text, txtLName_1.Text, txtEmpID_1.Text, cmbProNm1.SelectedItem, cmbAdmin1.SelectedItem, 1)
Dim sqlLogin As String = "Select * from login where user_name ='" & txtUsrNm_1.Text & "'"
Dim usrVerified As String = DataStore.ExecuteScalar(sqlLogin, sqlConnStr)
If usrVerified.Length > 0 Then
Call ClearData(1)
cnt = cnt + 1
End If
End If
If chkBox2_Crtusr.Checked Then
rtrnQry(txtUsrNm_2.Text, txtPswd_2.Text, txtFName_2.Text, txtLName_2.Text, txtEmpID_2.Text, cmbProNm2.SelectedItem, cmbAdmin2.SelectedItem, 2)
Dim sqlLogin As String = "Select * from login where user_name ='" & txtUsrNm_2.Text & "'"
Dim usrVerified As String = DataStore.ExecuteScalar(sqlLogin, sqlConnStr)
If usrVerified.Length > 0 Then
Call ClearData(2)
cnt = cnt + 1
End If
End If
If chkBox3_Crtusr.Checked Then
rtrnQry(txtUsrNm_3.Text, txtPswd_3.Text, txtFName_3.Text, txtLName_3.Text, txtEmpID_3.Text, cmbProNm3.SelectedItem, cmbAdmin3.SelectedItem, 3)
Dim sqlLogin As String = "Select * from login where user_name ='" & txtUsrNm_3.Text & "'"
Dim usrVerified As String = DataStore.ExecuteScalar(sqlLogin, sqlConnStr)
If usrVerified.Length > 0 Then
Call ClearData(3)
cnt = cnt + 1
End If
End If
Now when I am doing this, for each exception the error message is appearing twice, I need to take care of that as well. Please Help, Thanks in advance
modified on Friday, July 23, 2010 8:57 AM
|
|
|
|
|
You've posted the same question elsewhere: don't do that.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
Your code is unreadable, didn't you notice?
Please use <PRE> tags.
|
|
|
|
|