I am trying to follow this sample of inserting data through gridview rowcommand. But somehow Im missing the sqlparameter add method whilst the namespace was already added.
Code:
//sqlparameter declaration of list type
private List<SqlParameter> insertParameters = new List<SqlParameter>();
mygridview_rowcommand(...){
SqlParameter _prm_guid = new SqlParameter("@pk_guid", SqlDbType.VarChar);
_prm_guid.Direction = ParameterDirection.Input;
_prm_guid.Value = thisguid;
insertParameters.add(?); //error on add()
}
Some other part of the code which related to insertParameters variable it give an error
Code:
for statement cannot operate on variables of type List<System.Data.SqlClient.SqlParameter> because List<System.Data.SqlClient.SqlParameter> does not contain a public definition of GetEnumerator
how to set sqlparameter list(of sqlparameter ) to a gridview??
Code: Dim l As New List(Of System.Data.SqlClient.SqlParameter) l.Add(New System.Data.SqlClient.SqlParameter("@name", "joy")) l.Add(New System.Data.SqlClient.SqlParameter("@class", "neel"))
I am about to write a method that uses SQLParameter to insert some data into SQL server. However, do I "have" to specify a DBType? If not how is this handled?
I was trying to create a Dynamic Data Website using VS 2010 RC. An attempt to create an App_Code folder where I would put a LINQ to SQL class, failed. When I selected 'Add ASP.NET Folder' to add the folder, I had options to create only the following folders:
I want to access the data from datatable object. When i trying to get the fieldslist usng "Field" method. But I could not find the method with my table object. Eventhoguh i forcibly write a method and trying to access the fields, It is giving the below error for the first join in query. Rest of the lines are fine.
What is the reason behind it.
The errro: "Error 2 'LINQ2DB.SP_VS_OP' does not contain a definition for 'Field' and the best extension method overload 'System.Data.DataRowExtensions.Field<T>(System.Data.DataRow, string)' has some invalid arguments"
What is the meaningof the error. Shall i do any other changes in the query line?
var QueryChnl = from oSPOP in SPOP.AsEnumerable() join oDiscChannel in DiscChannel.AsEnumerable() on oSPOP.Field<int>("spid") equals oDiscChannel.Field<int>("SPID") join oChannel in Channel.AsEnumerable() on oDiscChannel.Field<int>("channel") equals oChannel.Field<int>("channelID") where oSPOP.Mappingkey == 3200004 select new { oSPOP.Mappingkey, oChannel.channel, oDiscChannel.STATUS };
my visual studio 2010 has the following problem, can't see the missing characters. Everything is fine, if I do a copy to notepad, it will show up. The intellisense is fine. (I manually removed the characters after copying here). My beta2 started to have the problem a month ago. Now I installed RC, same problem. My windows is XP SP3.
using ystem; using ystem. ollections. eneric; using ystem. inq; using ystem. eb; using ystem. eb. vc;
namespace vcApplication3. ontrollers { public class ccount ontroller : ontroller { // // : /Account/ public Action esult ndex() { return iew(); } } }
I have a solution with multiple projects in it that I converted to 2010 (kept the 3.5 framework). When it imported/converted the XSD files, the file structure went from:
The designer file is now missing, that had my constructor in it. Obviously, the project won't compile as it says "Type dd1149 is not defined" Why does it not include it with 2010, is there something I'm missing?
I wanted to run MVC 2 project, so I install VWD2010 Express Beta using Web Platform Installer 2.0 but it install the MVC Preview 2 not the RTM. I uninstall MVC 2 and MVC 2 VWD 2010 Tools and use again WPI but the MVC 2 VWD 20010 Tools is not installed. [:(]
Error 1 The type or namespace name'CreateUser' does not exist in the namespace'LocalGarageFinder.Membership' (are you missing an assembly reference?) I have checked the namespaces. all in. Security.Web.Security;
using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; [code]...
I just noticed something. When I right-click on the Controllers folder in a Visual Studio 2008 MVC 2 project, I get this dialog box:But when I do the same thing in Visual Studio 2010, I get this dialog box:tice that the Visual Studio 2010 version doesn't have Delete listed in the checkbox label and, in fact, it doesn't create a Delete action methodhy the difference between Visual Studio 2008 and 2010? Is there another way to do that, or do I have to create it by
Today in one of the computer i installed visual studio 2010 professional edition, and successfully installed. But in my new project template "Asp.net MVC 2 website" is missing. Also I'm not able to open an already created MVC 2 project also. I'm also having MVC 2 installed with VS 2008 Sp1 in the same machine and is working fine. I uninstalled and installed again, the same is happening.
I just moved into a new computer running Windows 7 pro, and I installed a new copy of VS2010. Now all of my old sites that I made in VS2008 do not have their web.config files. Does anyone know what happens to them in VS2010, or Windows 7?
Opening an existing asp.net 3.5 project using VWD Express 2010, the database diagram file under Database Diagrams folder went missing in Database Explorer tab. Everything is in there when I first created the diagram using VWD Express 2008. However, when I look at the .dbml file, the associated relationship between dozens of tables exist and my project runs successfully. I'm planning to create another table with relationships from existing tables but seems like I have to painfully recreate them back from scratch. How can I recover those diagrams?
my requirement is to add crystal report in my project which is developed in visual studio 2010 windows application.i have installed SAP Crystal report for VS2010 Successfully.but i cant find the control Crystl report viewer in my Toolbox.how to enable Crystal report viewer in VS2010 windows application.
I have fresh install windows wista 64 bit and trying install vs 2010 ultimate. When i agree i licence and clcik next i get "you have entered invalid product key" I have my extension key but i dont see any option where fill the key?
I have a Silverlight site hosted in an asp page, it has been developed using vs2010 using .net 3.5 framework and silverlight 4. It all works on my dev box. However when I publish the site and get it deployed I get the error:
Could not load file or assembly 'Moe.Tactical.Ttas.Web' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.BadImageFormatException: Could not load file or assembly 'Moe.Tactical.Ttas.Web' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
I have checked that the ISS asp setting are using 2.0.50727, and that all my references are using that runtime also.
I am not sure what to do to work out what the missing dependencies are at this point (I don't have access to the deployment box, I will have to go and sit with a system admin).
how I can make my VWD2010 show the window where I tick which exceptions I want the debugger to halt on throw rather than unhandled? MSDN docs imply that the menu can be customized to add it but this is NOT TRUE for my version
public static int ConceptInsert(string description, string keyword) { int result = -1; string connString = ConfigurationManager.ConnectionStrings["MySpaceConnectionString"].ConnectionString; string commString = "exec dbo.Concept_Insert @description"; using (SqlConnection conn = new SqlConnection(connString)) { using (SqlCommand comm = new SqlCommand(commString, conn)) { comm.Parameters.Add(new SqlParameter("@description", description)); comm.Parameters.Add(new SqlParameter("@keyword", keyword)); conn.Open(); result = comm.ExecuteNonQuery(); } } return result; }
But when I run the code, error message is always Procedure or function 'Concept_Insert' expects parameter '@keyword', which was not supplied. How can I pass those two parameters together to the stored procedure?
I've enhanced my web service with a new method. If I open a browser and type the url of the service, I get a list of the methods including the new one, so that looks okay.
I have a snippet of code which I paste to a Firebug console to test the method, and I am getting a 500 internal server error. If I use the same snippet of code and modify it to test one of the other methods, that works fine.
What I can look at to figure out what is wrong with this new method? The other weird thing is if I try to run the URL on the server it says The test form is only available for requests from the local machine. But I am on the local machine. So I don't know if something is screwed up there, too, or it's the same cause or what.
I know there's tons of advice on the Internet regarding server 500 errors but this is unique in that my web service is working except for the new procedure.
I think I will write another new procedure that's simple (like Hello World) and see if I can call that. This new method returns a list of objects but so does one of the older methods, so I don't know what would be unusual there
I have a <asp:Parameter Name="Person_ID" Type="String" />. My Updatecommand contains, among other things: Person_ID = @Person_ID. That's all fine.
In my code behind, how to I say that I don't want to specify a value for this parameter, but rather want it to use the default value (which in this case is NULL?)
Or rather than telling it to use the Default value, is it possible to set it to Null? I tried setting the value to Null, but the sql code that got generated was Person_ID = "NULL", which of course, is wrong. How do I get it to generate Person_ID=NULL?