Click here to Skip to main content
15,889,462 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
public void InsertUpdateDeleteSQLString(string sqlstring)//here why we use string sqlstring.can please any one can explain me in detail regarding this.

        {

            SqlConnection objsqlconn = new SqlConnection(conn);

            objsqlconn.Open();

            SqlCommand objcmd = new SqlCommand(sqlstring, objsqlconn);

            objcmd.ExecuteNonQuery();

 

        }

 

        public object ExecuteSqlString(string sqlstring)

        {

            SqlConnection objsqlconn = new SqlConnection(conn);

            objsqlconn.Open();

            DataSet ds = new DataSet();

            SqlCommand objcmd = new SqlCommand(sqlstring, objsqlconn);//how this sqlstring works here please explain me .

            SqlDataAdapter objAdp = new SqlDataAdapter(objcmd);

            objAdp.Fill(ds);

            return ds;

        }
Posted
Updated 25-Aug-14 18:44pm
v3
Comments
Sergey Alexandrovich Kryukov 25-Aug-14 21:39pm    
Sorry, who would waste time for explanation of who-knows-what, when it is probably too hard to explain to you why this post is not a good question? It's quite unclear what are you concerned which and what do you know about how other things work.
—SA
[no name] 25-Aug-14 22:07pm    
Pretty much any decent basic book on programming can explain what a string is and what a method parameter is.
Sanket Saxena 26-Aug-14 0:49am    
Suggesting you to go through "Functions", "How to pass parameters in the function" and "return type". This is very basic level things which you should know. All the best.

 
Share this answer
 
Everything should be clear from this MSDN article: http://msdn.microsoft.com/en-us/library/system.data.sqltypes.sqlstring%28v=vs.110%29.aspx[^].

If this is not clear to you, you probably need to explain what concerns you — please see my comment to the question.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900