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
Mfwamba Tshimanga
NA
155
46.1k
Instance failure...???
Jun 25 2014 11:08 AM
Hi!
I wrote this code but when I click on my save button. Its stack and show message that saying: instance failure. I do check the database path its sound correct. Its showing the but on
conn.open;
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 ElSoft_FactuStocks
{
public partial class Facturacao : Form
{
public Facturacao()
{
InitializeComponent();
bindCombo();
}
SqlConnection conn;
SqlCommand comm;
SqlDataReader dreader;
string connstr = @"Data Source=localhost\\sqlexpress;Initial Catalog=lunaoffice;Integrated Security=True";
private void btnGravar_Facturacao_Click(object sender, EventArgs e)
{
conn = new SqlConnection(connstr);
conn.Open();
// here
comm = new SqlCommand("insert into fact values(" + symb.Text + ",'" + nomeClienteFactu.Text + ",'" + artigoFactu.Text + "'," + leituraCodFactu.Text +
",'" + quantidadeFactu.Text + ",'" + precosaidaFactu.Text + ",'" + totalFactu.Text + ",'" + descontoFactu.Text + ",'" + utilizadores.Text + "')", conn);
try
{
comm.ExecuteNonQuery();
MessageBox.Show("Saved...");
}
catch (Exception)
{
MessageBox.Show("Not Saved");
}
finally
{
conn.Close();
}
}
Reply
Answers (
3
)
query string is not taking the search value
NOTHING on directly printing