|
In your code
return SqlHelper.ExecuteDataset(ObjDBAbstract.GetConnectionString(), "users_list", Guid.Empty);
in the ExecuteDataset try makng use of the USING statement, this will automaically close and dispose of your connection
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi,
I have a GridView which is teamed up with a DetailsView and they work fine. I've added New , Delete and Edit buttons to the DetailsView and that all works fine too.
The problem I have is what to do if there are no rows in the GridView . The DetailsView shows nothing, not even the buttons so I can't simply add a new item from there.
I can create a new button which will open a new page to create a new item but this seems very clumsy and inelegant.
Can someone suggest a better way of doing this? Is it possible to force the display of the DetailsView rows including the buttons, even if the GridView is empty?
Thanks
|
|
|
|
|
can update panels triger an event in paralle if yes how? please help
|
|
|
|
|
Hi - I'm new to vb.net and stuck with a little problem....I can write the string out as raw data but want to write it out so that it makes sense as "english" (formatted list I suppose). Can anybody help please? Here is my working code:
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Xml.Xsl" %>
<script runat="server">
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim strDataToPost As String
Dim myWebRequest As WebRequest
Dim myRequestStream As Stream
Dim myStreamWriter As StreamWriter
Dim myWebResponse As WebResponse
Dim myResponseStream As Stream
Dim myStreamReader As StreamReader
' Create a new WebRequest which targets that page with
' which we want to interact.
myWebRequest = WebRequest.Create( _
"http://test..co.uk/XmlService.asmx")
' Set the method to "POST" and the content type so the
' server knows to expect form data in the body of the
' request.
With myWebRequest
.Method = "POST"
.ContentType = "text/xml"
End With
' Here's the data I'll be sending. It's the same format
' you'd use in a querysting and you should URLEncode any
' data that may need it.
strDataToPost = "<RegionSearch>blah</RegionSearch>"
' Get a handle on the Stream of data we're sending to
' the remote server, connect a StreamWriter to it, and
' write our data to the Stream using the StreamWriter.
myRequestStream = myWebRequest.GetRequestStream()
myStreamWriter = New StreamWriter(myRequestStream)
myStreamWriter.Write(strDataToPost)
myStreamWriter.Flush()
myStreamWriter.Close()
myRequestStream.Close()
' Get the response from the remote server.
myWebResponse = myWebRequest.GetResponse()
' Get the server's response status?
' Just like when we sent the data, we'll get a reference
' to the response Stream, connect a StreamReader to the
' Stream and use the reader to actually read the reply.
myResponseStream = myWebResponse.GetResponseStream()
myStreamReader = New StreamReader(myResponseStream)
litResponseText.Text = myStreamReader.ReadToEnd()
myStreamReader.Close()
myResponseStream.Close()
' Close the WebResponse
myWebResponse.Close()
End Sub
</script>
<!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>
<title>ASP.NET HTTP Post Request Sample</title>
</head>
<body>
<form id="myForm" runat="server">
<p>
<strong>This page made an HTTP post request to:</strong><br />
<code> http://test..co.uk/XmlService.asmx
</code>
</p>
<p>
<strong>It sent regions request data:</strong><br />
</code>
</p>
<p>
<strong>The Response:</strong>
</p>
<table border="1">
<tr><td>
<asp:Literal ID="litResponseText" runat="server" />
</td></tr>
</table>
<hr />
</form>
</body>
</html>
Kind regards
Andy
|
|
|
|
|
I'm using this code to run process:
"...
_apppath = String.Concat(_apppath, "zvprtcfg_win32");
string _command = " Zan Image Printer(fax) print.html = ";
_command += strHtmlFileName;
try
{
Process _proc = new Process();
_proc.StartInfo.Arguments = _command;
_proc.StartInfo.FileName = _apppath;
if (_proc.Start())
{
int _i = 0;
do
{
_proc.WaitForExit(1000);
if (_proc.HasExited)
{
_bOk = true;
break;
}
} while (_proc.Responding && _i++ < 30);
if (!_bOk)
{
_proc.Kill();
}
}
}
catch (Exception eproc){}
..."
This works fine with my XP machine with IIS V5.1, but I can't make this work with Server 2003 and IIS V6.0.
In Server 2003, the process shows in the task manager, but it doesn't execute as I'm expecting.
ASPNET user run "zvprtcfg_win32" process on my machine and NETWORK SERVICE user run it on Server 2003.
Please give me some advice, solution...
Thanks in advance.
"...And then she'd say, it's Ok, I got lost on the way
but I'm a supergirl, and supergirls don't cry. ..." Reamonn
|
|
|
|
|
Hi,
I think the problem is the account "Network Service". This one will not have the rights to run your process as you expecting it. Try to figure out what rights for this user are missing (file, printer access etc.).
The network service is the default user for ASP.NET under Win2003 and IIS 6.0. Maybe you can figure out how to change the default use, so that ASP.NET is executed with other permissions.
Hope this helps you a bit.
Regards
Sebastian
P.S. Have a look at the event log of Windows, there you will find some information about critical operations etc, which where denied.
|
|
|
|
|
Thank you very much.
Everything you wrote I already know, but I totally forgot "P.S." part . And there (at the Event log) was solution to my problem.
Thanks once more.
Regards,
Nina
My problem was:
The machine-default permission settings do not grant Local Activation permission for Internet Explorer to the user NT AUTHORITY\NETWORK SERVICE.
"...And then she'd say, it's Ok, I got lost on the way
but I'm a supergirl, and supergirls don't cry. ..." Reamonn
|
|
|
|
|
I captured the value of Id of the browser using Request.Querystring but the problem is the value caputered had "+" symbol which is not being shown. Its taking as a concatination.
How can i handle.
|
|
|
|
|
The querystring will convert + sign to white space character. You have to write code for track this.
|
|
|
|
|
You need to make sure the querystring is URL Encoded. I use the following function that i find useful
Public Function Encrypt_UrlEncode(ByVal textToEncrypt As String) As String
Try
Return System.Web.HttpUtility.UrlEncode(textToEncrypt, System.Text.Encoding.Default)
Catch ex As Exception
Throw ex
End Try
end function
In your code before you redirect do something like this
Dim queryString as string=Encrypt_UrlEncode(WhatEverStringYouWantToPassAsQueryString)
response.redirect("http://www.abc.com/RedirectPage.aspx?Q=" & queryString)
Good Luck
RH
|
|
|
|
|
Hello,
I have a asp:listView control bound to a LinqDatasource, works fine.
In code behind (as a result of a buttonclick somewhere) i would like to get a dataitem from the datasource (or maybe the ListView) based on the Listviews SelectedIndex.
Tried to get it from listview.Items[listview.SelectedIndex], but the DataItem member is always null.
Any ideas?
Thanks in advance,
Antoon
|
|
|
|
|
Hi
Friends i am using auto complete extender (ajax) in my web page ,
Its something like showing city names
My problem is when the user types it doesnt displays the option when user halts for a second it displays the option
I want to know , this can be done simultaneously , as soon as the button is clicked options has to be shown
Please if anyone knows how it is done then do let me know
thanks and regards
( please go to apple.com and type iphone, You will notice the speed )
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
Pls Help me in the following issues..
I have programattically created link buttons inside the datagrid header and items as described below:-
*******
Sub DGDoc_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DGDoc.ItemCreated
Try
If e.Item.ItemType = ListItemType.Header Then
Dim DelLink As New LinkButton()
DelLink.Text = "Delete"
DelLink.Attributes.Add("runat", "server")
DelLink.Attributes.Add("id", "OnDelete")
DelLink.Attributes.Add("CommandName", "OnDelete")
DelLink.Attributes.Add("CommandArgument", "OnDelete")
'AddHandler DelLink.Command, AddressOf Dg_ItemDatabound
e.Item.Cells(8).Controls.Add(DelLink)
Dim EditLink As New LinkButton()
EditLink.Text = "Disp.Order/Edit"
EditLink.Attributes.Add("runat", "server")
EditLink.Attributes.Add("id", "OnEdit")
EditLink.Attributes.Add("CommandName", "OnEdit")
EditLink.Attributes.Add("CommandArgument", "OnEdit")
e.Item.Cells(7).Controls.Add(EditLink)
ElseIf e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
Dim DownLink As New LinkButton()
DownLink.Text = "Download"
DownLink.Attributes.Add("runat", "server")
DownLink.Attributes.Add("id", "OnDownload")
DownLink.Attributes.Add("CommandName", "OnDownload")
DownLink.Attributes.Add("CommandArgument", "OnDownload")
e.Item.Cells(5).Controls.Add(DownLink)
End If
Catch ex As Exception
Response.Write("Error :" & ex.Message)
End Try
End Sub
********
And clicking on to the link buttons created following code is to be executed
***
Sub Dg_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DGDoc.ItemCommand
Try
Select Case e.CommandName
Case "OnDownload"
---
Case "OnEdit"
---
Case "OnDelete"
---
End Select
Catch ex As Exception
Response.Write("Error :" & ex.Message)
End Try
End Sub
***
But my problem is i'm not getting the value of "e.CommandName"
Pls help me in resolving these issues
|
|
|
|
|
I think the CommandName property is cleaning at the time of postback. Check your code.
|
|
|
|
|
But Pls tell me how? pls suggest me someway to do things i want.
|
|
|
|
|
Hello!
I'm searching the flash video component for my simple video system.
I can't find any free component for publishing videos on my project.
Anyone can suggest me a component for showing videos.
and other queiston is;
How i can control uploaded contents to my server for to the harmfully files.
Last user can upload infected files to my server how i can prevent this.
Thanks.
Sorry for my bad english.
Greetings From Turkey.
|
|
|
|
|
Sosyopat wrote: I'm searching the flash video component for my simple video system.
I can't find any free component for publishing videos on my project.
Anyone can suggest me a component for showing videos.
Are you looking for an FLV player[^]?
Sosyopat wrote:
How i can control uploaded contents to my server for to the harmfully files.
Last user can upload infected files to my server how i can prevent this.
Try to call an anti virus routine which installed on server or something like that.
|
|
|
|
|
thanks for the reply.i found it at the last.
|
|
|
|
|
i have publish application of 3.5 in to 5.1
and when i run that application locally it runs fine... and
when i use virtual directory to run that project it gives error
object reference not set to the instance of the object..
and 3.5 option also not coming in iis 5.1
please help
umerumerumer
|
|
|
|
|
mr_muskurahat wrote: when i use virtual directory to run that project it gives error
object reference not set to the instance of the object..
Well, that is way too little information to be useful. You have to post the code where the error occurs for the error message to be any helpful.
mr_muskurahat wrote: and 3.5 option also not coming in iis 5.1
There is no separate frameworks with version 3.0 or 3.5. You are still using framework 2.0. They are just additions.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
|
Hi all,
on my page Cursor.Current = Cursors.WaitCursor is not working, does anyone know whats wrong with this line of code, do i have to do something else in addition to this.
thank you
|
|
|
|
|
ASP.NET is a different technology. Use CSS styles to define cursor.
|
|
|
|
|
|
Chris I'll do better next time, thanks
|
|
|
|