Search
 
SCRIPT & CODE EXAMPLE
 

SQL

db connection using sql client in dot net

SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Myconstr"].ToString()); 

SqlCommand cmd = new SqlCommand("sprocUserinfoInsertUpdateSingleItem", con);  
                cmd.CommandType = CommandType.StoredProcedure;  
                cmd.Parameters.AddWithValue("@Name", ObjBO.Name);  
                cmd.Parameters.AddWithValue("@Address", ObjBO.address);  
                cmd.Parameters.AddWithValue("@EmailID", ObjBO.EmailID);  
                cmd.Parameters.AddWithValue("@Mobilenumber", ObjBO.Mobilenumber);   
             con.Open();  
             int Result = cmd.ExecuteNonQuery();   
             cmd.Dispose(); 
             
    // or 
    
    con.open();
    
    if (con.State.Equals(ConnectionState.Closed)) con.Open();  
                    SqlDataAdapter da = new SqlDataAdapter(cmd);  
                    dt = new DataTable();  
                    da.Fill(dt);  
                    con.Close();  
                    return dt; 
             
             
Comment

PREVIOUS NEXT
Code Example
Sql :: psql fetch all rows with null 
Sql :: sqlite3 get data from table c 
Sql :: sql developer sql worksheet not showing 
Sql :: reorder primary key sql 
Sql :: sort by 
Sql :: SQL ANY and ALL Operators 
Sql :: select all fron table 
Sql :: what is server_default = func.now() in sqlalchemy 
Sql :: postgresql between month 
Sql :: como leer datos de mysql esp32 
Sql :: sql multiple column 
Sql :: Get the Domain Name, Page Name and Query Parameter from a URL 
Sql :: One table with another 
Sql :: how to create a new shema using query languaage 
Sql :: postgresql < ALL very slow 
Sql :: query to fetch 50% records from the table. 
Sql :: create user oracle hash by value 
Sql :: oracle archivelog usage 
Sql :: merge query using linked server 
Sql :: mamp mysql config file 
Sql :: create darabase in sql 
Sql :: sql find column with trailing space 
Sql :: Time difference in hh:mm:ss 
Sql :: mysql select where field is a value 
Sql :: sql express database size limit 
Sql :: how much space does sql server take per row 
Sql :: sql server assembly 
Sql :: conditional index in postgres 
Sql :: report in database 
Sql :: How to Alter column in SQL Server - NAYCode.com 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =