|
My code is not working and I don't know why? The function works by itself and returns a xml array. When I run the code and type in the textbox nothing happens.
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1" ServicePath="AutoComplete.asmx"
ServiceMethod="GetSuggested" MinimumPrefixLength="1" TargetControlID="TextBox1"
CompletionInterval="1" CompletionSetCount="3" EnableCaching="true" runat="server">
</cc1:AutoCompleteExtender>
Public Function GetSuggested(ByVal prefix As String) As String()
Dim sqlconn As New SqlConnection("Data Source=xxxx;Initial Catalog=xxxx;Integrated Security=True")
Dim dt As New DataTable()
Dim cmd As New SqlCommand("SELECT Name FROM OwnerDataSet WHERE Name Like '%" + prefix + "%'", sqlconn)
Dim adapt As New SqlDataAdapter(cmd)
Dim ds As New DataSet()
adapt.Fill(ds)
sqlconn.Open()
dt = ds.Tables(0)
Dim StringList As New List(Of String)()
For Each dr As DataRow In dt.Rows
StringList.Add(dr.Item(0).ToString())
Next
sqlconn.Close()
Return StringList.ToArray()
End Function
|
|
|
|
|
my code:in VBSCRIPT
Enter any additional notes
]]>
Can somebody can help me with how to insert data in sql server if i am takeing data that is inserted by the user on the website...
thanks in advance
|
|
|
|
|
Change this: kinjalkhamar wrote: sql9="insert into notes(note)values(& Request.Form("notes") )"
to either this:
<br />
sql9="insert into notes(note)values(" & Server.HTMLEncode(Request.Form("notes")) & ")"<br />
or this:
<br />
sql9="insert into notes(note)values(" & Server.URLEncode(Request.Form("notes")) & ")"<br />
Here's a reference to some documentation about the encode functions: http://www.aspnut.com/reference/encoding.asp[^]. You should always encode your data before allowing it in your database or you are opening yourself to cross-site scripting attacks. You should also use the ADO Command object and use Parameters instead of concatenating your SQL statements together or you're opening yourself to SQL Injection attacks.
Read up on both Cross Site Scripting and SQL Injection vulnerabilities and save your self a lot of pain down the road.
|
|
|
|
|
i want to make a poroject in .NET
pls giv me ideas .....
and web appln project
|
|
|
|
|
How about a spelling checker.
Brad
Australian
The PHP MVP
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
try creating a generic web sie builder using xml as settings/configuration file. this will expose you to a lot of .net concepts. if you need any help, feel free to ask
regards,
Ali
|
|
|
|
|
Hello,
I'm wondering if there are any published standards or best practices regarding payment pages in e-commerce websites. I've browsed the WC3 standards and couldn't find anything related to this. Basically, I'm wondering if a program could be written to parse HTML to determine if a particular page followed a particular standard or best practice. So the question is, is there such a recognized standard or best practice that can be checked against?
Thanks a lot!
Ian
|
|
|
|
|
In a word, no. There is no standard for this just as there is no real standard for login pages. There are guidelines that you should follow but that is the subject of long winded articles. I would say your best bet would be to use a payment portal like Paypal, Google Checkout or DPS, they'll handle security and all the behind the scenes financial stuff. When dealing with finance it's better to let a 3rd party handle it if you are not 100% confident that you know exactly what you are doing.
Brad
Australian
The PHP MVP
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
Thanks for taking the time! I appreciate this insight as I have no real experience in this area.
Ian
|
|
|
|
|
You're always welcome.
Brad
Australian
The PHP MVP
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
Hi,
I am currently developing a distributed application, which uses web services to perform communication.
In the simple case there's a main engine and external engine (on separate machines / servers).
Main engine part is written in C# and its communication part runs under IIS (currently clients are also running under IIS, but target environment will be Tomcat/Ajax probably).
What I am trying to do, is to implement bidirectional communication between both engines (using WS, to avoid further migration problems etc.)
I've assumed, that the two sides both: serve and consume a WS. Ie. MainEngine serves ServiceMain, and ExtEngine server ServiceExt
The communication scheme is as follows:
1) MainEngine executes
ExtEngine.connectMainEngine(mainEngineURL); //ExtEngine.Url is provided by user
providing the client with URL to ServiceMain WSDL. Here ExtEngine is a WS proxy class generated automatically by VS.NET from WSDL file
2) From now on bidirectional communication is possible, by executing services from ServiceMain in ExtEngine and from ServiceExt in MainEngine respectively
The problem is: mainEngineURL is hard-coded (at my development platform it's something like: http://localhost:2758/ServiceMain.asmx ). I'd like to get this URL (or at least the "localhost:2758" part) at runtime. I've tried using both: this.Server.UrlPathEncode(); and this.Server.MachineName from within class ServiceMain which inherits from System.Web.Services.WebService, but it's not quite it
In brief: how to get web service URL at runtime (in a WS server)?
OT: Is there a simpler way to implement bidirectional communication than providing two separate web services (some kind of callback)? The thing is - as far as I know (even with async WSs) - server can't explicitly call a method in client (comm. must be always initiated by client). Am I wrong? In this scenario what I'll be willing to do is:
client executes ServiceMain.RegisterExternalEngine(clientCallbackFunction) and from now on server can asynchronously send data to client (running this callback function - some kind of RPC ), and client can communicate with server using its web service forontend. This approach wouldn't require second servlet container/server on client side...
Regards,
MB
|
|
|
|
|
matmus wrote: I am currently developing a distributed application, which uses web services to perform communication.
Is there some specific reason you are not using a commercial application server that supports distributed applications?
led mike
|
|
|
|
|
led mike wrote: Is there some specific reason you are not using a commercial application server that supports distributed applications?
Let's just say that I am bound to IIS. But just out of curiosity: could you provide me with some examples of such "commercial app server"?
...The question about getting server adress under .NET/IIS remains open
|
|
|
|
|
matmus wrote: Let's just say that I am bound to IIS.
IIS is only part of the Microsoft Application Server Platform which supports Distributed Applications in many ways, here's one[^].
matmus wrote: The question about getting server adress under .NET/IIS remains open
That might be your question. Mine would be why aren't you doing some studying on the subject of Distributed Computing? I strongly suggest you do so before preceding.
led mike
|
|
|
|
|
Hi,
I dont know whether this is the forum to ask questions on web services as there are two forums, one on asp.net and other on web development..
Moderators may move this thread to the more suitable one..
Question:
Case 1: There are many C# client applications (eaxctly one C# windows application running on exactly one client machine, so cumulatively it many many client applcations) and one asp.net web server..
All these clients interact with web server independently..
Case 2: Same as case 1, many client applications, one web server but one difference.. There is a web service in between..
Which case has the best architecture and why???
|
|
|
|
|
som.nitk wrote: but one difference.. There is a web service in between
A difference from what? How are the clients interacting with the web service in case 1?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Guffa wrote: A difference from what? How are the clients interacting with the web service in case 1?
There is no Web Service in case 1.
There is a web server. And if you are asking what method of communication, then the answer is GET/POST methods..
|
|
|
|
|
som.nitk wrote: There is no Web Service in case 1.
Sorry, I meant to write web server.
som.nitk wrote: And if you are asking what method of communication, then the answer is GET/POST methods.
Then there isn't very much difference between the cases, really. A webservice also uses the POST method.
The web service approach adds a framework with a bit more structure for the communication. You get a clear specification of the methods that you expose, and different data types are handled automatically.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Guffa wrote: Then there isn't very much difference between the cases, really.
So which of these is better?
1. Just the communication if client with web server.
2. The client communicates with Web Service and it communicates with Web Server.
Som
|
|
|
|
|
Som.Paul wrote: 2. The client communicates with Web Service and it communicates with Web Server.
It doesn't work that way. The web service is a part of the web server, exactly as a web page. A web service actually works just as a web page, there is only a difference in how the data is formatted.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi,
I have a web service I created and uploaded to my server. In another project (output type .dll) I added a reference to the service via "Add Web Reference..." dialog. All seemed fine at first. A file called Reference.cs is added under the web reference node, and when I look at it, this looks just like the proxy class that is needed. The Build Action associated with this file is "Compile." I am also able to use intellisense to get access to the created proxy class, and when I load the .dll from another project in the same solution through the debugger, everything works fine.
However, when I copy the files from my bin\Release\ to another folder (and also calling the .dll from a separate solution altogether), I get an exception :
"System.TypeLoadException: Could not load type 'Trading.BrokerProxy.net.sbjgroup.CustomerMgmtSvc' from assembly 'SBJCharts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'..."
(where Trading.BrokerProxy.net.sbjgroup.CustomerMgmtSvc is the proxy class)
The other part of all of this, is that if I generate the proxy class via wsdl.exe and add the output to my project...at that point all works as expected (after I also remove the WebReference).
I'd really like to figure out what's going on here, as it would be much simpler just to add the WebReference and then everything works as expected.
Thanks in advance.
BW
|
|
|
|
|
AFAIK, ASP.NET actually builds the stuff in the Web References directory at run-time. Not sure how that works for non-ASP.NET projects.
You might get more help by asking in the C#, .NET, or ASP.NET forums - those folks are old pros at this crazy stuff.
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
Yes, that's what I had read also and I'd figured other project types would do the same, so I was surprised at the runtime exception...
I think maybe I'll try the .NET forum...this problem is hard to classify.
|
|
|
|
|
I am trying to find out if there is a code that could monitor (and read) packets going out and coming to a client program that communicates with a server program, such as in Instant Messaging programs that talk to a server.
Any help would be appreciated
|
|
|
|
|
Google Wireshark.
Brad
Australian
The PHP MVP
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|