Tag: asp.net

Comparing against database value

What I am trying to do is grab the current logged in users username and compare that against a database which contains users, and also includes an Active flag and an Admin flag. I want to compare the current logged in user in the tbl_Person table and their respective user in the table to see […]

how to get the value of certain selected value out from Stored Procedure

i just got started with ASP.Net, i only knew PHP so which means im a little stubborn. i need real examples. heres my problem, i got this class in a class library called Class1, it connects to the database and ask for verification of user login. public string userlogin(string loginuser,string loginpass) { string type = […]

ASP.NET connectionstring does not conform to specification

Hy! I am writing an asp.net application. I use entityframework 5 code first. I develop this site local, but I use the database of the webserver. When I publish this site to the webserver, I have to add the connection string in this way: <add name=”strConn” connectionString=”Data Source=localhost;Initial Catalog=DBNAME;Integrated Security=false;User ID=DBUSERNAME;Password=DBPASSWORD” /> instead of it: […]

Export XML file from SQL Server – NT AUTHORITY\NETWORK Service error

I’ve been trying to export the contents of an XML variable to a file on my disk from SSMS (SQL Server Management Studio) with the following command. EXEC xp_cmdshell ‘bcp “SELECT @xml_file” queryout “C:\Radu\bcptest.txt” -T -c -t’ When running this command I’m constantly getting this error: I’ve searched for answers and most of the things […]

How can I implement a local testing database for my Azure Website?

I have a website I’m developing that uses an SQL Azure database. I want to be able to test my website using a database locally hosted on the debugging machine so that my designer can work on style and content without having to deal with the overhead of firing up the Azure emulator and communicating […]

Filtering grid rows which DON'T have corresponding entries in another table

I’ve got a Telerik RadGrid with the following Select query in the data source it’s bound to: SELECT g.GroupID, c.ClientName, r.CarrierName, p.PlanName FROM Group AS g JOIN Client AS c ON g.ClientID=c.ClientID JOIN Carrier AS r ON g.CarrierID=r.CarrierID JOIN Plan AS p ON g.PlanID=p.PlanID The RadGrid has filterable columns, and the code behind is storing […]

How To Write Distance LINQ query i have Lat, Long in table with varchar type SQL Server

How to write a LINQ query for nearest points calculation? I have Lat and Lng in a table saved as string in a SQL Server database. Found one solution on stackoverflow the query look like this var coord = DbGeography.FromText(String.Format(“POINT({0} {1})”, latitude.ToString().Replace(“,”, “.”), longitude.ToString().Replace(“,”, “.”))); var nearest = (from h in db.hotels where h.location != […]

Encryption SQL Server 2005

I have a SQL Server 2005 Database and I am planning to encrypt some of my columns using PassByPhrase. But these columns have to be displayed in the original form on my ASP.Net web pages and on some Crystal Reports. Now I know that I will have to create a Stored Procedure to decrypt the […]

Updating Parameters In Data Source for a Report Viewer ASP.NET C#

I have the following controls: Data Source, Report Viewer, and two Telerik RadDateTimePicker. Screen shot of what my Rad Controls look like. My report is a client report definition (.rdlc). I have a stored procedure in my SQL 2008 database that I am using for the report, and the data source. I have configure with […]

Data Input asp.net C# SQL

Hey guys I am using a connection string database set-up inside visual studios 2012. I am trying to send data to the database there are no errors in the code but its not running, any help would be fantastic as i have been at it for a few hours now and need some sleep. Thanks. […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.