Click here to Skip to main content
15,893,594 members
Home / Discussions / C#
   

C#

 
GeneralRe: c# error Pin
NotPolitcallyCorrect6-Jul-13 10:35
NotPolitcallyCorrect6-Jul-13 10:35 
GeneralRe: c# error Pin
Eddy Vluggen6-Jul-13 11:35
professionalEddy Vluggen6-Jul-13 11:35 
GeneralRe: c# error Pin
User34906-Jul-13 12:15
User34906-Jul-13 12:15 
GeneralRe: c# error Pin
Eddy Vluggen9-Jul-13 8:55
professionalEddy Vluggen9-Jul-13 8:55 
GeneralRe: c# error Pin
Richard MacCutchan6-Jul-13 21:42
mveRichard MacCutchan6-Jul-13 21:42 
GeneralRe: c# error Pin
User34907-Jul-13 4:26
User34907-Jul-13 4:26 
GeneralRe: c# error Pin
Richard MacCutchan7-Jul-13 7:21
mveRichard MacCutchan7-Jul-13 7:21 
GeneralRe: c# error Pin
User34907-Jul-13 8:28
User34907-Jul-13 8:28 
the content of connection string is a access database file that i don't want to locally connect with my c# because it is updated every time and user can import to the program with reference year the records that associated with this year i try to make it locally connected in c# and i observe that the database does not updated when i make it import again from my desktop on my laptop so the database that it is locally connected to my c# program has old record in spite of the two file it is the same but on different locations (locally- desktop and the other can be import to c#) .

i use the following query to get the records with the associated reference year but i have the problem that i said previous :

public DataTable findref2(string refyear)
{
try
{
//create new new connection to the database
OleDbConnection conn = new OleDbConnection(connectionstringA);
//Set the command string
string Cmd = ("SELECT ReferenceYear FROM Questionnaires_Table1 Where ReferenceYear = '" + refyear + "' ");

//create new data adapter
OleDbDataAdapter Adapter = new OleDbDataAdapter(Cmd, conn);
//create new command builder
OleDbCommandBuilder sqlCmdBuilder = new OleDbCommandBuilder(Adapter);
dTable = new DataTable();
Adapter.Fill(dTable);
conn.Close();
}
catch (OleDbException e)
{
MessageBox.Show(e.ToString());
}
//return the search results on a datatable
return dTable;
}




how can i get data without make my database locally connected in my c# program and i have the possibility to get data when i import from anywhere on my laptop to c# program. i have already a form that i put the reference year and opened a window that i can choose the access db file and i can import to my c# program (because i move on my locally connected access database which is different from database i make import ) but only if the year i put previous is on access db file i choose. Now i try to make a select query to check if the reference year already exists on file but i have the error No database specified in connection string or IN clause maybe because i must make locally connection on c# but i don't want as i said previous.


can you help me please?

modified 7-Jul-13 15:31pm.

GeneralRe: c# error Pin
Richard MacCutchan7-Jul-13 20:38
mveRichard MacCutchan7-Jul-13 20:38 
QuestionC# SQL SELECT query taking too long Pin
IceUK5-Jul-13 5:48
IceUK5-Jul-13 5:48 
AnswerRe: C# SQL SELECT query taking too long Pin
fixthebugg5-Jul-13 6:00
fixthebugg5-Jul-13 6:00 
AnswerRe: C# SQL SELECT query taking too long Pin
Simon_Whale5-Jul-13 6:14
Simon_Whale5-Jul-13 6:14 
AnswerRe: C# SQL SELECT query taking too long Pin
Mycroft Holmes5-Jul-13 14:03
professionalMycroft Holmes5-Jul-13 14:03 
QuestionI am geting an error about callbackOnCollectedDelegate Pin
mahua225-Jul-13 2:11
mahua225-Jul-13 2:11 
AnswerRe: I am geting an error about callbackOnCollectedDelegate Pin
Ron Beyer5-Jul-13 3:40
professionalRon Beyer5-Jul-13 3:40 
AnswerRe: I am geting an error about callbackOnCollectedDelegate Pin
Alan N5-Jul-13 3:48
Alan N5-Jul-13 3:48 
GeneralRe: I am geting an error about callbackOnCollectedDelegate Pin
Ron Beyer5-Jul-13 4:44
professionalRon Beyer5-Jul-13 4:44 
QuestionDifference between {list}.First() and {list}[0] Pin
velvet75-Jul-13 0:59
velvet75-Jul-13 0:59 
AnswerRe: Difference between {list}.First() and {list}[0] Pin
Marco Bertschi5-Jul-13 1:18
protectorMarco Bertschi5-Jul-13 1:18 
AnswerRe: Difference between {list}.First() and {list}[0] Pin
Nicholas Marty5-Jul-13 1:24
professionalNicholas Marty5-Jul-13 1:24 
AnswerRe: Difference between {list}.First() and {list}[0] Pin
Pete O'Hanlon5-Jul-13 3:19
mvePete O'Hanlon5-Jul-13 3:19 
AnswerRe: Difference between {list}.First() and {list}[0] Pin
Abhinav S6-Jul-13 1:41
Abhinav S6-Jul-13 1:41 
Questionunable to insert data Pin
new to c# programming4-Jul-13 21:49
new to c# programming4-Jul-13 21:49 
AnswerRe: unable to insert data Pin
Pete O'Hanlon4-Jul-13 21:58
mvePete O'Hanlon4-Jul-13 21:58 
GeneralRe: unable to insert data Pin
new to c# programming4-Jul-13 22:48
new to c# programming4-Jul-13 22:48 

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.