|
hi
i made a local connection to accsess and i want to put the application on a server how can i deal with the connection ?
2nd-
i have pages made in asp and i want to make code that inserts record in db using asp not asp.net how it can be done ?
|
|
|
|
|
Hi everyone !
My code export data from a datagrid to file excel.
My code :
void Export(object sender, System.EventArgs e)
{
Response.Clear();
Response.Charset = "";
Response.Buffer = true;
this.EnableViewState = false;
Response.ContentType = "application/vnd.ms-excel";
Response.ContentEncoding = System.Text.Encoding.Default;
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
DataGrid dg = new DataGrid();
dg.DataSource = data.Tables[__tableSelector.CurrentTabIndex];
dg.DataBind();
dg.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
}
when I want read excel file above, I can't read because format file save as "web page"!
- How to read excel file above?
- The excel file transmit to client and user will modify infomation in the file. I will update to my database depen on file upload form a client by read this file in server. Although in server I have a folder share and permission for everyone full control. But access to server was denyed!
- How to write file upload to server?
Thanks for your times !
Vinh
|
|
|
|
|
Have you considered using XML for generating and reading the excel file? You can generate an XML file and transform it using the XSL transformations for excel. I don't know if this will solve your problem, but having an XML version will enable the portability you are describing (also will get rid of the web page view). Also, if you use a dataset you can get to the XML representation of the data fairly quickly.
Here's an example of performing an XSLT transformation of XML data.
Private Sub FormatToExcel(ByVal xmlInfo As XmlDocument)
Dim myXMLDoc As XmlDocument = xmlInfo
Dim myXSLT As New Xsl.XslTransform
Dim myText As New IO.StringWriter
Dim myNav As XPath.XPathNavigator = myXMLDoc.CreateNavigator
Dim myWriter As New XmlTextWriter(myText)
myXSLT.Load(Server.MapPath("xslt/ExcelReport.xslt"))
myXSLT.Transform(myNav, Nothing, myWriter, Nothing)
Response.AddHeader("content-disposition", "attachment; filename=eventregistrants.xls")
Response.ContentType = "text/xml"
Response.Write("<?xml version=""1.0""?>" & myText.ToString)
End Sub
And here's the XSLT file:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
<xsl:template match="*">
<ss:Workbook>
<ss:Worksheet ss:Name="Registration Data">
<ss:Table>
<ss:Row>
<ss:Cell ss:StyleID="ColumnHeader"><ss:Data ss:Type="String">First Name</ss:Data></ss:Cell>
<ss:Cell ss:StyleID="ColumnHeader"><ss:Data ss:Type="String">Last Name</ss:Data></ss:Cell>
<ss:Cell ss:StyleID="ColumnHeader"><ss:Data ss:Type="String">Email Address</ss:Data></ss:Cell>
ss:Type="String">Invoice ID</ss:Data></ss:Cell>
</ss:Row>
<xsl:for-each select="Registrants">
<ss:Row>
<ss:Cell ss:StyleID="ColumnData"><ss:Data ss:Type="String"><xsl:value-of select="FirstName"/></ss:Data></ss:Cell>
<ss:Cell ss:StyleID="ColumnData"><ss:Data ss:Type="String"><xsl:value-of select="LastName"/></ss:Data></ss:Cell>
<ss:Cell ss:StyleID="ColumnData"><ss:Data ss:Type="String"><xsl:value-of select="EmailAddress"/></ss:Data></ss:Cell>
<ss:Cell ss:StyleID="ColumnData"><ss:Data ss:Type="String"><xsl:value-of select="InvoiceID"/></ss:Data></ss:Cell>
</ss:Row>
</xsl:for-each>
</ss:Table>
</ss:Worksheet>
</ss:Workbook>
</xsl:template>
</xsl:stylesheet>
As for uploading files, you will need to incorporate a regular HTML File input control. Right click on the control and make sure the check "Run as server control". You then have access to methods and properties to save this file.
|
|
|
|
|
Hi everyone!
I use a datagrid.I want hide colums was maked by AutoGenerateColumns="true" but I don't know anyway.
When I use AutoGenerateColumns="false", AllowPaging="True" and OnPageIndexChanged="PageIndexChanged" my applacation can't call procedure "PageIndexChanged".
Thank for your times !
//My code
void PageIndexChanged(object sender, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
__theGrid.CurrentPageIndex = e.NewPageIndex;
BindData();
}
Vinh
|
|
|
|
|
maybe you should write your codes into Page_Load event, it's look like this:
private void Page_Load(object sender, System.EventArgs e)
{
BindData();
}
|
|
|
|
|
My application divide a datagrid into two parts.I use
method "dagagrid.Visible = false" in orde display infomation that I want.And I display many tables by tabstrip. It is difficult to display because Page_Load()
{
Bindata();
}
reload data in currentTab don't load data when tabstrip changed!
My codes write in html not that code behind.
thanks for reply!
Vinh
|
|
|
|
|
I have been asked to add search capabilities to an intranet using the indexing of iis. The documents are all searchable pdfs that have been scanned. Many of the documents have handwritten text that is not searchable by itself, so specific information has been encoded into the filename. I cannot, however, seem to figure out how to make a search form that allows users to search on the filename in addition to the text that has been indexed. Thank you in advance for your help!
|
|
|
|
|
How do I share an instance of a class between multiple calls to a Webservice?
I want to use my own connection pool to manage the connections to my database. I need to share that pool among the different calls to the webservice.
As I understand it, by default each call to a webmethod creates a new instance. I know you can turn on EnableSession - but I need somewhere I can put an instance where it can be used by any instance of a webmethod.
Help greatly appreciated!
Thanks,
Paul
/**********************************
Paul Evans, Dorset, UK.
**********************************/
|
|
|
|
|
Would it be just using the ASP.Net common object
Application["key"] ?
/**********************************
Paul Evans, Dorset, UK.
**********************************/
|
|
|
|
|
I have a JScript string that could potentially include text like this:
[url]whatever[/url]
I would like to replace it with:
<a href="whatever">whatever</a>
Any ideas how to do that? Thanks for any assistance!
|
|
|
|
|
Have you tried working with the JScript string object[^]?
If this is JScript.NET, you can just use the string class.
Is this client side? Server side?
Jon Sagara
"the good thing about hitting your head against a wall is when you stop"
-- l a u r e n's Web page
My Articles
|
|
|
|
|
No, it's standard JScript embedded in an ASP page (IIS5).. all server side.
Basically I have a discussion forum, which doesn't allow HTML, and I would like either:
(A) any links posted by the users to either appear automatically (e.g. some sort magic regular expression for "http:// + whatever + whitespace" replaces the text with a standard html link), -or-
(B) as an alternative, some sort of regular expression type search for "[url] + site.com + [/url]" and replace that with a standard html type link.
I found the following code on a site:
<a href="http://codelib.aspemporium.com/index.aspx?pid=110&cid=3">http://codelib.aspemporium.com/index.aspx?pid=110&cid=3</a>[<a href="http://codelib.aspemporium.com/index.aspx?pid=110&cid=3" target="_blank" title="New Window">^</a>]
Which looks to perform (A) above... however in converting the VBScript to server-side JScript I can't get the following line to work... this is my translation...
strOut = re.replace( strIn, "<A HREF=\"$1\">$1</A>" );
I assume the line about, the {1} is supposed to carry down into the $1 in this one in some fashion, but I don't quite understand how it works... and I can't seem to get it to work.
Any ideas? Simply finding a URL in any particular JScript String, and replacing it with an HREF is really all I need to do. Thanks for any help!
|
|
|
|
|
I'm no JScript expert, but I know David Wulff's[^] forums do what you're looking for, and, though written in C#, so to Mike Puddephat's[^].
I think David's are even written in JScript.
Jon Sagara
"the good thing about hitting your head against a wall is when you stop"
-- l a u r e n's Web page
My Articles
|
|
|
|
|
I'm actually running David's code on one of my servers, but (unless the beta is different than the release) I think it requires something like this to create a URL:
[url="http://www.forums.stardustsoftware.com"]The Stardust Software Web Site[/url]
The idea of a user being able to simply type http://www.site.com and have the display code parse and provide an HREF would be cool... but my JScript RegEx skills aren't quite good enough.
Regards, Larry
|
|
|
|
|
Ah, gotcha.
Larry Antram wrote:
but my JScript RegEx skills aren't quite good enough.
Ditto. I know that PHPBB does a good job of that, though. Don't know how well the RE will translate into JScript, though.
Sorry to keep pointing you around the web... just trying to promote "code reuse."
Jon Sagara
"the good thing about hitting your head against a wall is when you stop"
-- l a u r e n's Web page
My Articles
|
|
|
|
|
hello everyone, just wondering if anyone knows how to set a report with double columns, for example below
the numbers represent the lines
------------------------------------
1. field1 field 2 | 6. field1 field2
2. field1 field 2 | 7. field1 field2
3. field1 field 2 | 8. field1 field2
4. field1 field 2 | 9. field1 field2
5. field1 field 2 | .... field1 field2
it's like in MS word where you have two columns.
is there some settings that i have to do, or how can i achieve this, please help
i'm passing data into report by table in a dataset.
sitting here waiting for someone to reply.
*HyVong*
|
|
|
|
|
Hi people,
I have been using excel up to now for my work and now have chosen to expand to the net. I have one issue though with my work.....
I use a data loader that i coded through excel to oracle and i was thinking would it be possible to do create through asp a loader for this.
I.e log on to my site and select info and load from the site??
If anyone can help i can send them the excel loader and as a new member i have a gift for anyone that can help....a gmail account
cheers
steve
|
|
|
|
|
not sure if anyone still uses this, but I installed .NetFramework 1.0 sp1
(released, aug31,2004) and after that I was getting some javascript errors.
I have a user control inside a webform. basically have login.ascx inside login.aspx. the login.ascx contains the tag.
before the sp1 the form would render like this...
after sp1 it was this...
It is killing some of my javascript where I look for
"_ctl:Form1"!
any help would be greatly appreciated.
Ganesan Muthiah
email:ganerathu@hotmail.com
|
|
|
|
|
Hy !
I will like to be able to make a synchronization between two Web pages asp 3. I modify fields in a page and in the second the change is carried out dynamically...
Thank you for your assistance!
|
|
|
|
|
The second page should not be reloader because a activex is present and does not have to be reloader
|
|
|
|
|
I am trying to get a url with MSXML2.ServerXMLHTTP but turkish chacters in the url making problem that they seem as '?' how could I solve this problem.
Here is the my code....
<%<br />
Response.Buffer = true<br />
<br />
Dim objXMLHTTP, xml, text<br />
<br />
Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP")<br />
<br />
xml.Open "GET", "http://www.bektekeri.com/include/articles/article14.php", false<br />
xml.setRequestHeader "Content-Type", "xml/text"<br />
xml.setRequestHeader "characterset","windows-1254"<br />
xml.setOption(0) = 1524<br />
xml.Send<br />
<br />
text = xml.responsetext<br />
response.Write text<br />
<br />
Set xml = Nothing<br />
<br />
%>
karanba
|
|
|
|
|
Hi all,
i am trying to save images that are saved in a image field sql field. i am trying to do it whith :
'selecciono los datos de la imagen
cad="guarda_imagen '" & idproducto & "'"
cad="select * from imagenes inner join imagen_file on imagenes.idimagen=imagen_file.idimagen where pcode='6022SD'"
set result=cnximagen.Execute(cad,,adcmdtext)
nombre=result("filename")
set mstream=server.CreateObject("ADODB.Stream")
'Set mstream =new ADODB.Stream
mstream.Type =adTypeBinary
mstream.Open
mstream.Write result.fields("imagen")
mstream.SaveToFile "d:\Espots\" & result"filename"),adSaveCreateNotExist
but it stop in mstream.type=adtypebinary , the error said "argument in conflict whith others"
anyone know how fix it or how could i do it?
thanks
|
|
|
|
|
Howdey
Now you can look at my code but before you do that there is only two things that you must check.
(1) Do you have MDAC 2.5 or later installed (I think the Stream object is in any case only included in version 2.5 and later ...)
(2) I'm not using late binding - you are.
Other than that I don't know why you would get that error message.
Good luck anyways!
Below is my code:
Dim Rst As New ADODB.Recordset
Dim adoCon As New ADODB.Connection
Public Sub TEST_OPEN()
adoCon.ConnectionString = "PROVIDER=SQLOLEDB;DATA SOURCE=IANLAP;DATABASE=MYDB;USER ID=developer;PASSWORD=developer;"
adoCon.Open
'
Dim s As String
'
s = "Select [id],[data] From [tblImage] Where [id]=1"
Set Rst.ActiveConnection = adoCon
Rst.LockType = adLockOptimistic
Rst.CursorType = adOpenKeyset
Rst.Open s
'
Dim mStream As New ADODB.Stream
'
If Dir("C:\temppicture.bmp") <> "" Then Kill "C:\temppicture.bmp"
'
With mStream
.Type = adTypeBinary
.Open
.Write Rst("data")
.SaveToFile "C:\temppicture.bmp"
.Close
End With
Set mStream = Nothing
'
Rst.Close
Set Rst = Nothing
End Sub
Ian
|
|
|
|
|
I want to connect to MS ACCESS and rerieve records in a table using PHP. How can I achieve this?
samitha
|
|
|
|
|
I've never had a need for this personally; however, here is an example I found on the PHP site as a user contributed comment (http://ca.php.net/manual/en/ref.com.php):
$conn = new COM("ADODB.Connection");
$dsn = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . realpath("mydb.mdb");
$conn->Open($dsn);
Also check pear.php.net I know they have an absraction layer class that will do the trick. Remember that you need COM installed with PHP
|
|
|
|