SQL Server :: Trying To Learn More About Building Web Services By Constructing?
Jan 19, 2011
I am wondering if you might be able to with a little problem.I am trying to learn more about building web services by constructing one but I have run into what I think is a syntax problem that I can't figure out. Below is my C# code:
How to Find All the Web Services and Windows Services Running on a Server in ASP.Net. I have the server details with me and want to find all the Web services running on it.
I've been worked with web services so far, and I'm interested in expanding my services to console applications as well so I started digging up with WCF but I'm conserned that I won't be able to use the HttpContext collection that I've been used to do with web services one important thing which is to generate a random value from HttpContext.Current.Request.ServerVariables["ALL_HTTP"] that I need to reckon if it's the same or at least near what machine that is calling my service. How can I overcome this problem?
I need to know what machine is calling to count the number of attempts to login into my system for example. So must do it inside of the svc code otherwise if I let the client inform what ip address or what computer he is using, anyone could forge this argument and surpass by another machine. May be I'm approaching this matter wrongly. And I should count the number of attempts per state session, but how is it done?
I'm constructing a query using linq, but I'm having trouble using a collection, i.e. where field in database = anything in the collection.
Below is an example of what I mean:
dim keywords as string ="test,test2,test3,cats,dogs,frogs" Dim getKeywords = (From cp In myDataContext.pages Where cp.pageKeywords = currentPageKeywords.Split(",")
The aim of the above code is to return all records where the "pageKeywords" field contains 1st keyword, or 2nd keyword, or 3rd keyword etc.
I need to dynamically construct a url by appending new parameter to the current url.
I know how to do this in the long way by getting the current url and check if there is any QueryString, if no add "?" if yes add "&". Also check is the parameter is already exist. If yes change the value.
But is there any build in .NET function to do this? Like Request.QueryString.Add
I need to implement a search page where a user will be able to specify some search criteria and perform a search. It's a requirement that the results are displayed on the same page, beneath the search criteria.
Here's the code for the controller class:
[Code]....
For simplicity, the table string above is hard coded but would be constructed dynamically in the real code. I also have the following form defined In the body of my html:
[Code]....
Finally, I'm using JQuery to hijack the submission of the form and to request the html for the table:
I am trying to implement admin login and operators(india,australia,america) login, now operator id starts with 'IND123' 'AUS123' and 'AM123'
when operator india logs in he can see the details of only members have id 'IND%', the same applies for an australian and american users
and when admin logs in he can see details of members with id 'IND%' or 'AUS%' or 'AM%'
i have a table which defines the role i.e admin or operator and their prefix(IND,AUS respectively)
In loginpage i created a session for Role and prefix
PREFIX = myReader["Prefix"].ToString(); Session["LoginRole"] = myReader["Role"].ToString(); Session["LoginPrefix"] = String.Concat(PREFIX + "%"); works fine
In main page(after login) i have to count the number of member so i wrote
string prefix = Session["LoginPrefix"].ToString(); string role = Session["LoginRole"].ToString(); if (role.Equals("ADMIN")) StrMemberId = "select count(*) from MemberList"; else StrMemberId = "select count(*) from MemberList where MemberID like '"+prefix+"'";
Problem: 1. i want to constructor parameter something like
StrMemberId = "select count(*) from MemberList where MemberID like '@prefix+'"; myCommd.Parameters.AddWithValue("@prefix", prefix);
Which is not working
2 Displaying the members in gridview i need to give condition (something like if (role.Equals("ADMIN")) show all members else show member depending on the operator prefix)the list of members in operator mode and admin mode. - where to put the condition in gridview how to apply these
I have to set GridView.DataKeyNames(This is really a question about the syntax for a string array, in VB.Net.)
I am discovering the PrimaryKey columns names from within a loop, ie:
For Each fld As IEntityField In Me.llbDataSource.EntityCollection(0).PrimaryKeyFields 'fld.Name ' this is where the column name is stored, so I have to get this into an array Next I can not use this syntax.
So, basically, how does one declare a string array (as required by GridView.DataKeyNames), and then populate the elements of the array from within a loop?
I render HTML returned from an ajax call and currently uses simple html controls and the string that is returned from the ajax call looks like this:
string s = "<tr><td><a href="#">MyLink</a></td></tr>";
Now, on the click on these links I need to do some processing on the server side to determine where I need to navigate to and for other information. My understanding is that I cannot use <asp:linkbutton /> in this html string I am building. How do I make a server side call if i don't want to use ajax.
How do I do the old chestnut of scanning a directory of documents and building a web page that displays the list with built in links to the documents. Also the usual UPLOAD and DELETE functions would be good in order to add more or remove documents from the web form.
I come from a ColdFusion background where this would easily be acheived with the <CFDIRCTORY> and <CFFILE> tags...... !!
i have a database with many tables. I want to implement add/update/delete functionality on each of them Is there any tool available which will build the webpages for each table with add/update/delete functionality.
We have a cient we are stting up that has 2 separate physical servers, one that is the web server the other the database server. Using impersonation we have been able to get the website to connect and retrieve data from the sql server so that part is not an issue. The problem is I have a windows service application that must be installed on the web server (as it process files downloaded to an ftp site) and it must be able to connect and write to the sql server as well.We tried adding a system.web block with the impersonation stuff to the app.config file which of course did not work. Can anyone tell me what/how we need to configure this properly?
How is it possible to browse to one of the .rdl reports in the sql server reporting services on the report server?At present I can succesfully browse to the report by:http://servername/reportsthen I see a folder called "ReportFiles" which holds the reports (.rdl files)then I click on one of the .rdl files in there to see the report.Do you in asp.net know how I can go to one of the reports?
I have seen some examples on other sites , but since im not familiar enough with DirectoryInfo and Files from the System.IO namespace, i dont know how to change it to fit my needs. So i found a very simple example that works, but i have some questions.
Here is the code i found:
[Code]....
This works great and lists the files in my root directory.
#1 - What i need to know is how to accomplish the same thing but in a format i can control, this code simply displays the files at the top of my page and pushes everything down. So does anyone know of a good and simple tutorial written in C#?
#2 - I also need to be able to setup the code so that certain files within the directories are not displayed, as in the code behind files and other files to be determined by the business.
My intention is to give the user a flexible user control on a master page that does the following:
When navigating, a child page will pass the URL (with querystring) and PageTitle to the user control. The user control will take those two parameters and insert them as a "breadcrumb" object at first index of a List<breadcrumb> collection
This part works fine through the use of a Repeater with a LinkButton contained in an ItemTemplate. The user sees each of the pages he has been visiting in descending order, the provided benefit is a quick way to re-open records they have recently modified or created.
The part I'm having trouble handling is what happens when the user clicks the LinkButton, which is that the child page adds a new reference to the URL at the beginning of the List<> collection and I cannot seem to control the behavior of removing the LinkButton before it gets re-created. What I've tried doing is:
While that should work, my CreateBreadCrumb(string url, string title) function gets called by the child page before the UserControl detects the Repeater1_ItemCommand event, so in effect it appears that the wrong ItemIndex is being used for removal.
I am using Visual Studio 2010 Release candidate1. I have to deploy my web application which consists of a website, certain window services, certain WCF services and Sql Server 2005 database.I read Vishal Joshi's blog(http://vishaljoshi.blogspot.com/2009/09/overview-post-for-web-deployment-in-vs.html) detaing Web Package in VS2010. I want to know how to deploy window services and WCF services using Web Package. Also, I want to create a web setup (.msi) for deployment instead of Web Package so that the .msi takes care of all the application and database deployment like the web package does.
Can someone explain me about SQL Server Reporting Service and using it in ASP.net?Typically I design my reports by Crystal Report, assign the data source to crystal report an produce my report.What is the benefits of using SQL Server Reporting Service and how to use it?
i have created simple hello world WCF services it is working fine in local machine but when i try to uploaded to the server and then run that service it not at al start like http://localhost:8080/wcf/helloservice.svc
i am trying to modified the webconfig file <endpoint> address i have changed to my servername.com/wcf/helloservice.svc again it shows error can give usefull link to creation and deployment to the server
i want to update table using web service file, i am retriving value like this :
[WebMethod] public DataSet getinfo() { SqlConnection con = new SqlConnection(@"Data Source=WEBTECHNO1WEBTECHNO;Initial Catalog=blogsite;Integrated Security=True");[code].....
how can i update table using this web service , what should return type in update and all these things...
Does anyone have a sample code on this? I want to call the FedEx "Rate Available Services/Rate Shopping" Service to retrieve pricing for various services.
I have an ASP.NET application running on IIS6 on a Windows 7 machine. I also have a SQL2008 R2 with Reporting Service.
My site is purely internal, so to make the life of the users easier I discarded a logon page by using Windows Authentication in IIS and validating the username on my default page.
I configured the Reporting Services using the Reporting Services Configuration Manager, using Network Services, and I can follow both the Web Service URL as well as the Report Manager URL just fine, all is happy. Untill... I try to load a report.
I have an aspx page with a Reportviewer control that just blatantly refuses to display the report. I know I have the report server and report path correct because I am able to manipulate and set report parameters dynamically. However, instead of the report displaying, I get a lovely message "A network related or instance specific error occurred while establishing a connection to SQL Server. The server was not found or was not accesible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error 25 - Connection String is not valid) Now, I looked up the error and everything is set up as it should be. My NT AUTHORITYNETWORK SERVICES users has all the privileges it needs, my server allows remote connections, TCP and named pipes are enabled...