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

C#

 
AnswerRe: Help me please ! Immediately ! Pin
J4amieC12-Apr-06 3:56
J4amieC12-Apr-06 3:56 
GeneralRe: Help me please ! Immediately ! Pin
svmilky12-Apr-06 6:08
svmilky12-Apr-06 6:08 
GeneralRe: Help me please ! Immediately ! Pin
Dave Kreskowiak12-Apr-06 6:20
mveDave Kreskowiak12-Apr-06 6:20 
GeneralRe: Help me please ! Immediately ! Pin
_Bao_12-Apr-06 6:46
_Bao_12-Apr-06 6:46 
GeneralRe: Help me please ! Immediately ! Pin
Dan Neely12-Apr-06 7:03
Dan Neely12-Apr-06 7:03 
GeneralRe: Help me please ! Immediately ! Pin
J4amieC24-Apr-06 7:27
J4amieC24-Apr-06 7:27 
AnswerRe: Help me please ! Immediately ! Pin
deanofharvard12-Apr-06 7:37
deanofharvard12-Apr-06 7:37 
Questionproblems connecting to local database Pin
valiovalio12-Apr-06 2:30
valiovalio12-Apr-06 2:30 
Hi, I`m using visual studio 2005. I`ve created a local database "db.mdf", and I`m just trying to connect with, but when I run code it throws an exception:
ServerVersion = 'sqlconn.ServerVersion' threw an exception of type 'System.InvalidOperationException'
and after that the program stops to respond...What should I do to connect?
here is my code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace DB
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
string c = "Data Source=(local);database=db.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True";

SqlConnection sqlconn = new SqlConnection(c);
sqlconn.Open();
string query = "SELECT ASM_VARDAS, ASM_PAVARDE, ASM_GIM_DATA FROM v_ASMENYS WHERE ASM_AK = ";
SqlCommand sqlcomm = new SqlCommand(query, sqlconn);

SqlDataReader reader = sqlcomm.ExecuteReader();
reader.Read();
}
}
}
AnswerRe: problems connecting to local database Pin
leppie12-Apr-06 2:57
leppie12-Apr-06 2:57 
GeneralRe: problems connecting to local database Pin
valiovalio12-Apr-06 3:18
valiovalio12-Apr-06 3:18 
GeneralRe: problems connecting to local database Pin
esjq12-Apr-06 3:42
esjq12-Apr-06 3:42 
GeneralRe: problems connecting to local database Pin
valiovalio12-Apr-06 4:11
valiovalio12-Apr-06 4:11 
QuestionPseudo Coloring Pin
Anindya Chatterjee12-Apr-06 1:27
Anindya Chatterjee12-Apr-06 1:27 
Questionhow converting from character to binary in c# ? Pin
abdallahziad12-Apr-06 0:53
abdallahziad12-Apr-06 0:53 
AnswerRe: how converting from character to binary in c# ? Pin
Jakob Farian Krarup12-Apr-06 1:11
Jakob Farian Krarup12-Apr-06 1:11 
GeneralRe: how converting from character to binary in c# ? Pin
abdallahziad12-Apr-06 1:29
abdallahziad12-Apr-06 1:29 
Generalso can u help me ? Pin
abdallahziad12-Apr-06 2:07
abdallahziad12-Apr-06 2:07 
GeneralRe: so can u help me ? Pin
_mubashir12-Apr-06 2:18
_mubashir12-Apr-06 2:18 
GeneralRe: so can u help me ? Pin
abdallahziad12-Apr-06 2:34
abdallahziad12-Apr-06 2:34 
AnswerRe: so can u help me ? Pin
Guffa12-Apr-06 3:12
Guffa12-Apr-06 3:12 
GeneralRe: how converting from character to binary in c# ? Pin
Jakob Farian Krarup12-Apr-06 8:09
Jakob Farian Krarup12-Apr-06 8:09 
Generaldear Jakob Lund Krarup Pin
abdallahziad12-Apr-06 13:51
abdallahziad12-Apr-06 13:51 
GeneralRe: dear Jakob Lund Krarup Pin
Jakob Farian Krarup12-Apr-06 19:56
Jakob Farian Krarup12-Apr-06 19:56 
QuestionI need some help here Pin
Mohamed Hussein Ragab12-Apr-06 0:45
Mohamed Hussein Ragab12-Apr-06 0:45 
AnswerRe: I need some help here Pin
Michael P Butler12-Apr-06 1:57
Michael P Butler12-Apr-06 1:57 

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.