.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Can't get value from db

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :ASP.Net
I'm trying to get a value from my db, but I get nothing. Can you help me? I have productid in querystring ALTER PROC CatalogGetDepartmentById @productId INT AS SELECT DISTINCT c.DepartmentId FROM [Product] AS p INNER JOIN ProductCategory AS pc ON pc.ProductId = @productId INNER JOIN Category AS c ON c.CategoryId = pc.CategoryId public static string GetDepartmentId(string productId) { DbCommand com = GenericDataAccess.CreateCommand(); com.CommandText = "CatalogGetDepartmentById"; // create a new parameter DbParameter param = com.CreateParameter(); param.ParameterName = "@productId"; param.Value = productId; param.DbType = DbType.Int32; com.Parameters.Add(param); return GenericDataAccess.ExecuteSelectCommand(com).ToString(); }string productId = Request.QueryString["ProductId"]; string departmentID = CatalogAccess.GetDepartmentId(productId); Response.Write(departmentID); // Just for test    

View Complete Post

More Related Resource Links

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend