|
There is a good tutorial for what you're trying to do by Faisal Khan. It starts with uploading images to a database and ends with displaying images from a database. Hope this helps, just go to the site below.
http://www.stardeveloper.com/articles/display.html?article=2003040501&page=1
-- modified at 23:18 Thursday 7th June, 2007
|
|
|
|
|
I got the following error message when I run my web method
There is no source code avaliable for the current location..
seema
|
|
|
|
|
That's a debugging error. When do you get it ? Is it all you get ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"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 )
|
|
|
|
|
Not sure if this is the correct board, but I'll try here.
I am trying to add a custom aspx page to my Sharepoint site. Here are the steps I've taken:
- Published my site with VS 2005
- Created a blank aspx page with Sharepoint Designer
- Copied the published aspx page into the newly created one in Designer
- Added the dll to my Sharepoint bin folder
- Added the following line to my web.config:
<br />
<SafeControl Assembly="App_Web_mzeq_hmf" Namespace="_Default" TypeName="*" Safe="True" /><br />
This is apparently the only way to have custom aspx pages in WSS 3.0/MOSS 2007, which is annoying.
When I try to run the page I get this error:
An error occurred during the processing of /contact.aspx. Value cannot be null.
Parameter name: key
I have no idea what that means. I thought it might have to do with not having a PublicToken parameter, but that was just a blind stab at what that might mean.
Any help on this would be great!
Thank you!
|
|
|
|
|
Hello.
When I add a new record in my gridview, I would like to select directly that new row instead of returning on the first row.
I'm using Primarykey in the gridview, and the gridview paging.
Is it possible to do that ?
Thanks a lot for your help.
Pat3d
|
|
|
|
|
Hi All,
I am writing internet application proxy for which i have to convert HttpContext.Current.Request object to WebRequest object such that i pass on all the information from Request to WebRequest.
Any ideas?
Thanks,
Amit
|
|
|
|
|
You can't convert them, they are two seperate objects for different purposes. What are you trying to accomplish?
only two letters away from being an asset
|
|
|
|
|
I am trying to write internet application which will be hosted by me and used by client but application need to access the database which is exposed as webservice in intranet.
Now, i was thinking of hosting a application proxy on client side which will access webservice in intranet environment and then call my application in internet. For an example say client need access Default.aspx page, it will go the application proxy and depending on which page i am trying to access application proxy will get the information from client database and then it will reconstruct the webrequest and send the request to my application.
Thats what i am trying to achieve. Let me know if i can achieve above funtionality some other way.
Thanks,
Amit
|
|
|
|
|
Let me know when you work this out.
only two letters away from being an asset
|
|
|
|
|
Hi. I've created a SSRS chart report that I'd like to display in my .net web application via web services. I've found a few examples that work with SSRS 2000 but not 05. I've managed to get the report to write to a pdf file but I'm unable display it directly in a browser. My code is below, any help will be greatly appreciated. Also if anyone knows where I can review some SSRS 2005 examples of displaying reports on a web page, that would be great! Thanks!
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim rs As RSwebReference.ReportingService2005 = New RSwebReference.ReportingService2005()
Dim rsExec As RSwebReference.ReportExecutionService = New RSwebReference.ReportExecutionService()
'Authenticate to the Web service using Windows credentials
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
rsExec.Credentials = System.Net.CredentialCache.DefaultCredentials
'Assign the URL of the Web service
rs.Url = "http://localhost/REPORTSERVER$SQL2005/ReportService2005.asmx"
rsExec.Url = "http://localhost/REPORTSERVER$SQL2005/ReportExecution2005.asmx"
Dim results As Byte() = Nothing
Dim historyID As String = Nothing
Dim format As String = "pdf"
Dim encoding As String
Dim mimeType As String
Dim extension As String
Dim warnings() As RSwebReference.Warning
Dim streamIDs() As String = Nothing
Dim fileName As String = "C:\samplereport.pdf"
Dim deviceInfo As String = Nothing
'Dim deviceInfo As String = _
' "<deviceinfo>" + _
' "<toolbar>False" + _
' "<parameters>False" + _
' "<docmap>True" + _
' "<zoom>100" + _
' ""
'Define variables needed for GetParameters() method
Dim _reportName As String = "/Test/AuditVendorStatus"
Dim _historyID As String = Nothing
Dim _forRendering As Boolean = False
Dim _values As RSwebReference.ParameterValue() = Nothing
Dim _credentials As RSwebReference.DataSourceCredentials() = Nothing
Dim _parameters As RSwebReference.ReportParameter() = Nothing
Try
'Get if any parameters needed.
'_parameters = rs.GetReportParameters(_reportName, _historyID, _forRendering, _values, _credentials)
'Load the selected report.
Dim ei As RSwebReference.ExecutionInfo = rsExec.LoadReport(_reportName, historyID)
'---------------------------------------------------------
'Set the parameters for the report needed.
'create an array of the values for the report parameters
'Dim parameters(1) As RSwebReference.ParameterValue
'Dim paramValue As RSwebReference.ParameterValue
'paramValue = New RSwebReference.ParameterValue
'paramValue.Name = "StartDate"
'paramValue.Value = ""
'parameters(0) = paramValue
'paramValue = New RSwebReference.ParameterValue
'paramValue.Name = "EndDate"
'paramValue.Value = ""
'parameters(1) = paramValue
'rsExec.SetExecutionParameters(parameters, "en-us")
'---------------------------------------------------------
results = rsExec.Render(format, deviceInfo, extension, encoding, mimeType, warnings, streamIDs)
'Create a file stream and write the report to it
Dim stream As System.IO.FileStream = System.IO.File.OpenWrite(fileName)
stream.Write(results, 0, results.Length)
Catch ex As Exception
'TODO
End Try
End Sub
|
|
|
|
|
hi
i hav deploped url in asp.net..
how to run the url in linux...there is the way...?
|
|
|
|
|
Balaji.K wrote: how to run the url in linux...there is the way...?
Yes.
By Using
(1) XSP
(2) Apache.
For more details Here[^]
Regards,
Satips.
|
|
|
|
|
You can use,
* Apache
* Grasshopper
|
|
|
|
|
hi all..
My asp.net application has a dropdowlist, am populating employee names in it from the database,i want one color for the active employees and another color for the inactive employees..is it possible to color the items of the dropdown based on a condition..
plz..help..
|
|
|
|
|
|
Hi,
I have created a custom asp:CreateUserWizard control. I have also included in the <WizardSteps> a <asp:WizardStep> control for personal information. Why doesn't my required field validator want to fire??
Last Name *<br />
<asp:TextBox
ID="txtLastName"
Columns="30"
MaxLength="50"
runat="server" /><br />
<asp:RequiredFieldValidator
ID="RequiredFieldValidator_LastName"
ControlToValidate="txtLastName"
Display="Dynamic"
ErrorMessage="First Name required"
ValidationGroup="CECreateUserStep1"
runat="server">Required
</asp:RequiredFieldValidator>
When I remove the ValidationGroup="CECreateUserStep1" setting then it works fine.
Please can someone help me with my confusion??
Regards
ma se
|
|
|
|
|
I pretty sure that someone came across the same dilemma: Where should I maintain the database connection object, should I open it once when the web application is started and close id when it is terminated or should I open and close it with each session.
Which strategy is the one that is usually used ?
|
|
|
|
|
A database connection should be opened as late as possible and closed as soon as possible. So you should only open it when needed in your application, like when retrieving data to bind to a datagrid for instance, not when the initial page that only has static content is displayed.
only two letters away from being an asset
|
|
|
|
|
Hi,
When we do the export to excel from a webpage it works fine. But when I try to do the same thing from a popup window, it is doing nothing. It is not exporting the data. I am opening the popup using window.showModalDialog() method. The code that I am using to export the grid is
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.xls";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
myDataGrid.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
Please let me know the solution for this.
THanks,
sridhar.
|
|
|
|
|
I don't think you can display excel file in modal dialog. Can't you use window.open() instead of window.showModalDialog() ?
If you need to use modal dialog, then put an iframe in your modal dialog page:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ModalDialogPage.aspx.cs" Inherits="ModalDialogPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Excel export</title>
<link type="text/css" rel="Stylesheet" href="ModalDialogPage.css" />
</head>
<body>
<form id="form1" runat="server">
<div>
<iframe name="excelExporter" src="excelExporter.aspx"></iframe>
</div>
</form>
</body>
</html>
note stylesheet file modalDialogPage.css:
body
{
margin:0px 0px 0px 0px;
padding:0px 0px 0px 0px;
border: none 0px #000000;
width:100%;
height:100%;
}
iframe
{
margin:0px 0px 0px 0px;
padding:0px 0px 0px 0px;
border: none 0px #000000;
width:100%;
height:100%;
scrolling:no;
frameborder ;
}
and then you can put your excel generating code into your excelExporter.aspx page.
should be working!
Pilo
|
|
|
|
|
I didn't completely understand what you are saying. But here is the problem I am facing. In the popup window I have the tag <base target="_self" />. THis tells the browser to display the results in the same window instead of opening in a new window. So when I do the export to excel it is not able to display the save/open dialog because of that. If I remove that tag, it is able to display that dialog but the problem is everytime I do a postback it opens the new window to display the results.
Thanks,
sridhar.
|
|
|
|
|
I have figured the solution for this. I have added onclick event to the excel button. The onclick event will open a new window using window.open method. In that new window I have the code that exports the data to excel.
Thanks,
sridhar.
|
|
|
|
|
Hi, I have tried to upload a file to a MySQL database for a week now and still have problems. Would you please check to see what is causing the exception "Invalid cast from System.String to System.Byte[]." The following are my code for uploading a file to the database. I would really like to know why its giving me that error message, thank you in advance for your help.
----------------------------------------------------------------------------------------------------------------------------------------
| Field | Type | Null | Key | Default | Extra |
----------------------------------------------------------------------------------------------------------------------------------------
| docID | int(11) | NO | PRI | NULL | AUTO_INCREMENT |
|
| docTitle | varchar(30) | NO | | NULL | |
|
| docContent | MediumBlob | NO | | NULL | |
|
| docDate | timestamp | NO | | CURRENT_TIMESTAMP | |
|
| docType | varchar(15) | NO | | NULL | |
----------------------------------------------------------------------------------------------------------------------------------------
Imports System.IO
Imports System.Data.Odbc
Public Class Upload
Inherits System.Web.UI.Page
Private Sub Submit1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Submit1.Click
Dim strFileEx As String
Dim StrFileType As String
Dim intFileLen As Integer
Dim objStream As Stream
Dim strInsert As String
Dim myConnection As OdbcConnection
Dim cmdInsert As OdbcCommand
If Not IsNothing(txtFileContents.PostedFile) Then
'Determines File Type
strFileEx = Right(txtFileContents.PostedFile.FileName, 4)
Select Case strFileEx.ToLower
Case ".doc"
StrFileType = "doc"
Case ".ppt"
StrFileType = "ppt"
Case ".htm"
StrFileType = "htm"
Case ".html"
StrFileType = "html"
Case ".txt"
StrFileType = "txt"
Case Else
StrFileType = "jpg"
End Select
'Grab the content of uploaded file
intFileLen = txtFileContents.PostedFile.ContentLength
Dim arrFile(intFileLen) As Byte
objStream = txtFileContents.PostedFile.InputStream
objStream.Read(arrFile, 0, intFileLen)
'Add UpLoaded file to a database
myConnection = New OdbcConnection("Provider=MySQLProv; Data Source=Data;User Id=myID;Password=myPWD")
strInsert = "INSERT into QUsers (docTitle,docContent,docDate,docType) values (?,?,?,?,?)"
cmdInsert = new odbcCommand(strInsert,myConnection)
cmdInsert.Parameters.Add("@docID",OdbcType.int,30)
cmdInsert.Parameters["@docID"].Values =""
cmdInsert.Parameters.Add("@docDate", OdbcType.TimeStame,14)
cmdInsert.Parameters["@docDate"].Values = DateTime.Now.ToShortDateString()
cmdInsert.Parameters.Add("@docTitle", OdbcType.Varchar,30 )
cmdInsert.Parameters["@docTitle"].Values = txtFileTitle.Text
cmdInsert.Parameters.Add("@docType", OdbcType.Varchar,30)
cmdInsert.Parameters["@docType"].Values =StrFileType
cmdInsert.Parameters.Add("@docContent",OdbcType.Text)
cmdInsert.Parameters["@docContent"].Values =arrFile
myConnection.Open()
cmdInsert.ExecuteNonQuery()
myConnection.Close()
End If
End Sub
End Class
|
|
|
|
|
Hi,
Your parameter "@docContent" its datatype should be OdbcType.Binary or OdbcType.VarBinary.
Coz these two datatypes are mapped to an array of Byte.
I hope this will help you.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
I have changed that error you have pointed out but I still get the same error message. The change from Odbctype.Text to OdbcType.Binary had been made for @docContent and still VS2003 throws the same exception. I don't know what else to do, all of the other variables have been checked for invalid type
casting and I don't see any. Please help me spot the error. Thank you in advance for your help.
-- modified at 23:29 Thursday 7th June, 2007
|
|
|
|