Click here to Skip to main content
15,914,066 members
Home / Discussions / C#
   

C#

 
AnswerRe: MCTS 7-536 Dumps PinPopular
Michael Schubert11-Feb-10 6:06
Michael Schubert11-Feb-10 6:06 
AnswerRe: MCTS 7-536 Dumps Pin
Michael Schubert11-Feb-10 6:10
Michael Schubert11-Feb-10 6:10 
QuestionRegistering managed COM into HKCU Pin
SRKSHOME18-Jan-10 23:24
SRKSHOME18-Jan-10 23:24 
AnswerMessage Closed Pin
18-Jan-10 23:50
stancrm18-Jan-10 23:50 
GeneralRe: Registering managed COM into HKCU Pin
SRKSHOME19-Jan-10 0:14
SRKSHOME19-Jan-10 0:14 
GeneralRe: Registering managed COM into HKCU Pin
Shameel19-Jan-10 7:52
professionalShameel19-Jan-10 7:52 
GeneralRe: Registering managed COM into HKCU Pin
SRKSHOME19-Jan-10 19:42
SRKSHOME19-Jan-10 19:42 
Questionwats error in this code when i tend to insert the table from file v.txt.... Pin
vidhulibra 18-Jan-10 22:23
vidhulibra 18-Jan-10 22:23 
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);//errorMad | :mad:
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)

modified on Wednesday, January 27, 2010 6:54 AM

AnswerRe: C# Pin
OriginalGriff18-Jan-10 22:30
mveOriginalGriff18-Jan-10 22:30 
AnswerRe: pls respond to this Pin
Keith Barrow18-Jan-10 23:35
professionalKeith Barrow18-Jan-10 23:35 
QuestionThe Exception is" Provides an invalid parameter" Please help me. Pin
SrhLj18-Jan-10 21:14
SrhLj18-Jan-10 21:14 
AnswerRe: The Exception is" Provides an invalid parameter" Please help me. Pin
OriginalGriff18-Jan-10 22:36
mveOriginalGriff18-Jan-10 22:36 
GeneralRe: The Exception is" Provides an invalid parameter" Please help me. Pin
SrhLj19-Jan-10 0:09
SrhLj19-Jan-10 0:09 
GeneralRe: The Exception is" Provides an invalid parameter" Please help me. Pin
OriginalGriff19-Jan-10 0:25
mveOriginalGriff19-Jan-10 0:25 
QuestionDot matrix printer on crystal report in c# Pin
koncuk18-Jan-10 20:49
koncuk18-Jan-10 20:49 
AnswerRe: Dot matrix printer on crystal report in c# Pin
Ashfield18-Jan-10 21:18
Ashfield18-Jan-10 21:18 
AnswerRe: Dot matrix printer on crystal report in c# Pin
OriginalGriff18-Jan-10 22:40
mveOriginalGriff18-Jan-10 22:40 
GeneralRe: Dot matrix printer on crystal report in c# Pin
koncuk18-Jan-10 22:48
koncuk18-Jan-10 22:48 
AnswerRe: Dot matrix printer on crystal report in c# Pin
darkelv18-Jan-10 23:42
darkelv18-Jan-10 23:42 
GeneralRe: Dot matrix printer on crystal report in c# Pin
koncuk18-Jan-10 23:55
koncuk18-Jan-10 23:55 
GeneralRe: Dot matrix printer on crystal report in c# Pin
darkelv19-Jan-10 3:00
darkelv19-Jan-10 3:00 
AnswerRe: Dot matrix printer on crystal report in c# Pin
Shameel19-Jan-10 7:56
professionalShameel19-Jan-10 7:56 
GeneralRe: Dot matrix printer on crystal report in c# Pin
koncuk20-Jan-10 1:33
koncuk20-Jan-10 1:33 
AnswerRe: Dot matrix printer on crystal report in c# Pin
Murugesan Solaiyappan12-May-10 7:02
Murugesan Solaiyappan12-May-10 7:02 
QuestionMessage Removed Pin
18-Jan-10 20:05
user20518-Jan-10 20:05 

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.