TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Israel
635
1.3k
215.9k
All the day without saving another column...
Jun 26 2014 1:45 PM
Hi!
There is a something I didnt understand... I passed all the day for that.
I have a table named fact1 with two column
column name datatype Allows null
S nchar(10)
Designacao nchar(10)
Now with these codes I can save. There is n problem.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace LunaOffice
{
public partial class Facturacao : Form
{
public Facturacao()
{
InitializeComponent();
}
SqlConnection conn;
SqlCommand comm;
//SqlDataReader dreader;
string connstring = @"Data Source=inac-pc\sqlexpress;Initial Catalog=master;Integrated Security=True";
private void btnGravar_Facturacao_Click(object sender, EventArgs e)
{
conn = new SqlConnection(connstring);
conn.Open();
comm = new SqlCommand("insert into fact1 values(" + symb.Text + ",'" + artigoFactu.Text + "')", conn);
try
{
comm.ExecuteNonQuery();
MessageBox.Show("Saved...");
}
catch (Exception)
{
MessageBox.Show("Not Saved");
}
finally
{
conn.Close();
}
But when I add another column for example "codigo" with same datatype "nchar(10)".
When I click its says "Not saved". What wrong??????? I passed all the day just without solution.
see what I add. But nothing:
comm = new SqlCommand("insert into fact1 values(" + symb.Text + ",'" + artigoFactu.Text + "'," + leituraCodFactu.Text + "')", conn);
Reply
Answers (
3
)
How to send marks from student marks entry view to controlle
open directory full screen