Posts

Donate

How To Call SQL Server Stored Procedure Using LINQ And C#.NET

Good evening. Here's a basic example of how to call a SQL Server Stored Procedure Using LINQ And C#.NET 1. Make sure you have Northwind database in your Sql server. 2. Create a simple stored procedure to retrieve customers based on a specific country. The parameter of the stored procedure is of type varchar. 3. Create a simple asp.net website or winforms or console project. 4. Add a Linq to SQL class to your project. 5. Make sure to add the stored procedure in your linq to sql class. 6. In your asp.net website, add a button,textbox and a gridview. 7. In your button event click, add the following snippet: 1 2 3 4 5 6 7 8 protected void Bind () { string country = this .txtCity.Text.Trim(); var cr = new NorthWindDataContext(); var north = cr.CustomerByCountry(country); this .gridCustomers.DataSource = north; this .gridCustomers.DataBind(); } That's it...

Incorrect Syntax Near % Sql Parameter In C#.NET and SQL Server

When writing sql statements in your business logic layer, you often want to append % which is a literal in your query. An example would be like this: string query = "Select * from Patient where LastName like '" + "@family" + " %'" ; However, this would give you an error, since the @family parameter is inside the tick marks that makes it a literal, but the % sign should be inside the tick marks. So, the correct sql syntax would be this way: string query = "Select * from Patient where LastName like (@family + '%')" ; Source: VBForums Link

Set Top Property Of Text And Field Object Of Crystal Reports During Runtime

I have encountered a scenario when creating crystal reports for a specific customer. In my reports, I have four controls. 1. Comments (Text Object) and Comments (Field object )w/ top properties of 3465. 2. Recommendations (Text Object) and Recommendations (Field object ) w/ top properties of 4505. Here's what i need to do. 1 2 3 if ((recommendations field object ! = null) && (comments field object == null))) 2 : If true , set top properties of Recommendations Text 3 : object and commendations Field object to 3465. Solution in VBForums. Greg

Linux, Free BSD, Oracle articles

Here's a site from a friend of mine containing series of topics on Linux and open source softwares. http://www.opensolutions101.com/

"No description found" Error Message Pops-Up When Creating SQL Server Maintenance Plan In SQL Server 2005

If there are instances that you failed to create maintenance plan (backup plan) in MS SQL due to the error specified above, the solution would be to reregister MSXML. Solution: http://support.microsoft.com/kb/922546

Unable To Print Reports Using Samsung Printers and Crystal Reports In ASP.NET Web Forms

I encountered lately an error when printing a report from a deployed asp.net website. I installed correctly the printer software/drivers. The printer used was Samsung. Solution: In Control Panel (Printers and Faxes), add asp.net user account to the default printer.

The Official Microsoft ASP.NET Site

http://www.asp.net/ (Main ASP.NET Website)

ASP.NET 2.0 Quickstarts

Hi, Here is a link to some quickstart lessons in asp.net http://quickstarts.asp.net/QuickStartv20/aspnet/default.aspx Enjoy

Welcome Message!!!

Guyz, I'll be filling up this blog site with tons of tutorials from different Information Technology specializations. Keep in touch and Godbless!!! Though most of my projects are .NET based, I do have lots of tutorials and solutions on classic visual basic (VB 6.0) since, I have been developing projects and teaching that language long time ago. Cheers

Donate