Click here to Skip to main content
15,923,087 members
Home / Discussions / C#
   

C#

 
AnswerRe: help Pin
hammerstein0527-Jan-10 8:39
hammerstein0527-Jan-10 8:39 
GeneralRe: help Pin
hammerstein0527-Jan-10 9:39
hammerstein0527-Jan-10 9:39 
GeneralRe: help Pin
DaveyM6927-Jan-10 12:11
professionalDaveyM6927-Jan-10 12:11 
AnswerRe: help Pin
Eddy Vluggen27-Jan-10 8:48
professionalEddy Vluggen27-Jan-10 8:48 
AnswerRe: help Pin
DaveyM6927-Jan-10 9:18
professionalDaveyM6927-Jan-10 9:18 
GeneralRe: help Pin
Luc Pattyn27-Jan-10 9:35
sitebuilderLuc Pattyn27-Jan-10 9:35 
AnswerRe: help Pin
harold aptroot27-Jan-10 9:21
harold aptroot27-Jan-10 9:21 
QuestionProblem with events... Pin
Kaikus27-Jan-10 5:17
Kaikus27-Jan-10 5:17 
AnswerRe: Problem with events... Pin
PIEBALDconsult27-Jan-10 5:28
mvePIEBALDconsult27-Jan-10 5:28 
AnswerRe: Problem with events... Pin
N a v a n e e t h27-Jan-10 5:33
N a v a n e e t h27-Jan-10 5:33 
AnswerRe: Problem with events... Pin
hammerstein0527-Jan-10 7:27
hammerstein0527-Jan-10 7:27 
GeneralRe: Problem with events... Pin
Kaikus27-Jan-10 22:05
Kaikus27-Jan-10 22:05 
QuestionHow to make Shapes Window invisible in Visio through Programmatically Pin
NarVish27-Jan-10 4:37
NarVish27-Jan-10 4:37 
AnswerRe: How to make Shapes Window invisible in Visio through Programmatically Pin
NarVish27-Jan-10 5:27
NarVish27-Jan-10 5:27 
QuestionSQL Pin
jojoba201027-Jan-10 4:21
jojoba201027-Jan-10 4:21 
AnswerRe: SQL Pin
Rob Philpott27-Jan-10 4:26
Rob Philpott27-Jan-10 4:26 
QuestionRe: SQL Pin
jojoba201027-Jan-10 4:28
jojoba201027-Jan-10 4:28 
AnswerRe: SQL Pin
PIEBALDconsult27-Jan-10 5:29
mvePIEBALDconsult27-Jan-10 5:29 
QuestionProblem with a newer version of a dll Pin
KittyKit27-Jan-10 2:58
KittyKit27-Jan-10 2:58 
AnswerRe: Problem with a newer version of a dll Pin
ddecoy27-Jan-10 3:17
ddecoy27-Jan-10 3:17 
GeneralRe: Problem with a newer version of a dll Pin
KittyKit27-Jan-10 3:30
KittyKit27-Jan-10 3:30 
GeneralRe: Problem with a newer version of a dll Pin
ddecoy27-Jan-10 3:37
ddecoy27-Jan-10 3:37 
GeneralRe: Problem with a newer version of a dll Pin
KittyKit27-Jan-10 4:47
KittyKit27-Jan-10 4:47 
Questionsystem._ComObject databinding [modified] Pin
ddecoy27-Jan-10 2:30
ddecoy27-Jan-10 2:30 
Questionpls explain the error i have stated with the code....(wen i tend to insert the datas into the table) Pin
vidhulibra 27-Jan-10 1:10
vidhulibra 27-Jan-10 1:10 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Data.Odbc;
using System.Data.Common;
using System.Data;
using System.IO;

namespace sample27
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
MessageBox.Show("values get inserted");
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void button1_Click(object sender, EventArgs e)
{
textBox1.Text = "";
textBox2.Text = "";
}
}
class v
{
public static void main(string[] args)
{
string name = null;
string pwd = null;
int i=0;
string connstr = "/*connection string*/"
SqlConnection conn = new SqlConnection(connstr);
conn.Open();
StreamReader sr = new StreamReader(@"e:\v.txt");
string query = "insert into samplereg(username,password) values(@username,@password)";
name= sr.ReadLine();
while (name != null)
{
i++;
SqlCommand cmd = new SqlCommand(query, conn);
cmd.Parameters.Add("@username", name);Mad | :mad: //error
cmd.Parameters.Add("@password", pwd );
cmd.ExecuteNonQuery();
name = sr.ReadLine();
conn.Close();
}
}
}
}
Mad | :mad: error:Add(string parametername,object value) has been depricated.use Addwithvalue(String parametername,object value)
pls reply me ......

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.