Click here to Skip to main content
15,890,282 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to change ToolBar BackColor Pin
KrIstOfK7-May-06 22:39
KrIstOfK7-May-06 22:39 
QuestionNeed an advice on creating a text editor Pin
Cristoff7-May-06 21:05
Cristoff7-May-06 21:05 
AnswerRe: Need an advice on creating a text editor Pin
J4amieC7-May-06 21:55
J4amieC7-May-06 21:55 
GeneralRe: Need an advice on creating a text editor Pin
Cristoff7-May-06 23:34
Cristoff7-May-06 23:34 
GeneralRe: Need an advice on creating a text editor Pin
J4amieC7-May-06 23:41
J4amieC7-May-06 23:41 
GeneralRe: Need an advice on creating a text editor Pin
Cristoff8-May-06 4:08
Cristoff8-May-06 4:08 
QuestionInserting data into SQL Server database Pin
cshivaprasad7-May-06 19:51
cshivaprasad7-May-06 19:51 
AnswerRe: Inserting data into SQL Server database Pin
freshonlineMax7-May-06 20:12
freshonlineMax7-May-06 20:12 
Hello dear friend
Please notice below codes

We have a table with 3 fields as :
(field1:Int, field2:NVarChar, field3:Bit)

At first of your form add these namespaces:
<br />
using System.Data;<br />
using System.Data.SqlClient;

Now add these sample lines to your Button_Click() event :
<br />
string strInsert="INSERT INTO table (field1,field2,field3) VALIUES (@field1,@field2,@field3)";<br />
if (SqlConnection1.state.toString() != "Open")<br />
  SqlConnection1.Open();<br />
sqlCommand cmd = new SqlCommand(strInsert,sqlConnection1);<br />
cmd.Parameters.Add(new SqlParameter("@field1",SqlDbType.Int,4,"field1"));<br />
cmd.Parameters["@field1"].Value = 1000;<br />
cmd.Parameters.Add(new SqlParameter("@field2",SqlDbType.NVarChar,10,"field2"));<br />
cmd.Parameters["@field2"].Value = "California";<br />
cmd.Parameters.Add(new SqlParameter("@field3",SqlDbType.Bit,1,"field3"));<br />
cmd.Parameters["@field3"].Value = true;<br />
cmd.ExecuteNonQuery();<br />

Don't remember to define SqlConnection
if you have any problem mail me
Bye Bye

-- modified at 2:13 Monday 8th May, 2006
GeneralRe: Inserting data into SQL Server database Pin
cshivaprasad7-May-06 21:34
cshivaprasad7-May-06 21:34 
AnswerRe: Inserting data into SQL Server database Pin
kalyanhere8-May-06 18:36
kalyanhere8-May-06 18:36 
Questionsppech sdk5.1 Pin
TheEagle7-May-06 19:38
TheEagle7-May-06 19:38 
QuestionSSL implementation problem....... Pin
Neeraj Arora7-May-06 18:17
Neeraj Arora7-May-06 18:17 
Questionnetwork configuration with C# Pin
jpablo12057-May-06 17:54
jpablo12057-May-06 17:54 
AnswerRe: network configuration with C# Pin
Ravi Bhavnani7-May-06 18:57
professionalRavi Bhavnani7-May-06 18:57 
GeneralRe: network configuration with C# Pin
jpablo12058-May-06 4:48
jpablo12058-May-06 4:48 
QuestionConvert.ToInt32() Pin
yongwpi7-May-06 16:32
yongwpi7-May-06 16:32 
AnswerRe: Convert.ToInt32() Pin
Ravi Bhavnani7-May-06 16:58
professionalRavi Bhavnani7-May-06 16:58 
AnswerRe: Convert.ToInt32() Pin
Christian Graus7-May-06 18:25
protectorChristian Graus7-May-06 18:25 
GeneralRe: Convert.ToInt32() Pin
yongwpi8-May-06 7:01
yongwpi8-May-06 7:01 
AnswerRe: Convert.ToInt32() Pin
HimaBindu Vejella8-May-06 0:10
HimaBindu Vejella8-May-06 0:10 
QuestionWebsite forms Pin
ChrisSharp7-May-06 15:37
ChrisSharp7-May-06 15:37 
AnswerRe: Website forms Pin
Ravi Bhavnani7-May-06 17:00
professionalRavi Bhavnani7-May-06 17:00 
QuestionBinary image segmentation Pin
haj_duke7-May-06 12:53
haj_duke7-May-06 12:53 
AnswerRe: Binary image segmentation Pin
Guffa7-May-06 12:57
Guffa7-May-06 12:57 
QuestionCopyFileEx Problem Pin
teejayem7-May-06 12:46
teejayem7-May-06 12:46 

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.