Click here to Skip to main content
15,921,113 members
Home / Discussions / Database
   

Database

 
GeneralRe: SQL Server CE "IF" Problem Pin
Mike Dimmick3-Mar-08 3:15
Mike Dimmick3-Mar-08 3:15 
GeneralRe: SQL Server CE "IF" Problem Pin
Jacquers3-Mar-08 6:24
Jacquers3-Mar-08 6:24 
Questionhow to use crytal report with vb? Pin
sejal_tank29-Feb-08 0:41
sejal_tank29-Feb-08 0:41 
GeneralRe: how to use crytal report with vb? Pin
yogesh_kumar_agarwal29-Feb-08 0:52
yogesh_kumar_agarwal29-Feb-08 0:52 
Generaldatabinding textbox to a database Pin
laziale28-Feb-08 23:04
laziale28-Feb-08 23:04 
GeneralRe: databinding textbox to a database Pin
Joe28-Feb-08 23:13
Joe28-Feb-08 23:13 
GeneralRe: databinding textbox to a database Pin
laziale28-Feb-08 23:26
laziale28-Feb-08 23:26 
GeneralRe: databinding textbox to a database Pin
yogesh_kumar_agarwal29-Feb-08 0:09
yogesh_kumar_agarwal29-Feb-08 0:09 
use the following : -


<br />
<br />
1. Import the SqlClient namespace<br />
<br />
2. Create the object of SQL Connect to bind with SQLServer<br />
<br />
SQLConnection con=new SQLConnection("Initial Catelog=test;Data Source=.;user id=sa;password=pwd");<br />
<br />
here <br />
<br />
Data Source is the computer name on which the database in created<br />
Initial Catelog is the database name available on the server<br />
user id is the user id for database as on password<br />
<br />
<br />
3. Now create the command object to give the sql command to the sever<br />
<br />
SQLCommand cmd=new SQLCommand(sqlstr,con);<br />
<br />
here con is the object for connection and sqlstr is the query to execute like in our case it is<br />
<br />
"insert into tbltest values ('" + txtname.text + "')"<br />
<br />
4. Now Execute the command using cmd object<br />
<br />
cmd.ExecuteNonQuery();<br />
<br />
<br />
Remember to open the connection using <br />
con.Open()<br />
before xecution of Query.<br />
<br />
<br />


If fell any trouble then plz reply

With Regards

Yogesh Agarwal
GeneralRe: databinding textbox to a database Pin
laziale29-Feb-08 0:28
laziale29-Feb-08 0:28 
GeneralRe: databinding textbox to a database Pin
yogesh_kumar_agarwal29-Feb-08 0:57
yogesh_kumar_agarwal29-Feb-08 0:57 
GeneralRe: databinding textbox to a database Pin
laziale29-Feb-08 1:20
laziale29-Feb-08 1:20 
GeneralInserting strings that contains comma Pin
Deques28-Feb-08 21:33
Deques28-Feb-08 21:33 
GeneralRe: Inserting strings that contains comma Pin
Colin Angus Mackay28-Feb-08 21:44
Colin Angus Mackay28-Feb-08 21:44 
Generalsearch the data using GSM modem Pin
ieyra20428-Feb-08 17:59
ieyra20428-Feb-08 17:59 
GeneralConcurrency violation: the DeleteCommand affected 0 of the expected 1 records. Pin
baranils28-Feb-08 8:19
baranils28-Feb-08 8:19 
GeneralDeleted Record In SQL TAble Pin
kibromg28-Feb-08 7:12
kibromg28-Feb-08 7:12 
GeneralRe: Deleted Record In SQL TAble Pin
pmarfleet28-Feb-08 19:54
pmarfleet28-Feb-08 19:54 
GeneralProblem with update statement Pin
matjame28-Feb-08 3:20
matjame28-Feb-08 3:20 
GeneralRe: Problem with update statement Pin
matjame28-Feb-08 3:21
matjame28-Feb-08 3:21 
GeneralLinked Server communication throws 'MSDTC on server is unavailable' error Pin
Steven J Jowett27-Feb-08 22:57
Steven J Jowett27-Feb-08 22:57 
GeneralDifference between SQLSERVER 2000 and SQLSERVER 2005 Pin
anujose27-Feb-08 21:52
anujose27-Feb-08 21:52 
GeneralRe: Difference between SQLSERVER 2000 and SQLSERVER 2005 Pin
Giorgi Dalakishvili27-Feb-08 22:11
mentorGiorgi Dalakishvili27-Feb-08 22:11 
GeneralRe: Difference between SQLSERVER 2000 and SQLSERVER 2005 Pin
scottgp28-Feb-08 2:40
professionalscottgp28-Feb-08 2:40 
JokeRe: Difference between SQLSERVER 2000 and SQLSERVER 2005 Pin
Xmen Real 28-Feb-08 4:35
professional Xmen Real 28-Feb-08 4:35 
Questionsqlcommandbuilder.getdeletecommand Pin
rizwan127-Feb-08 20:36
rizwan127-Feb-08 20:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.