Click here to Skip to main content
15,895,084 members
Home / Discussions / Database
   

Database

 
GeneralRe: SQL Query Issue: MSSQL vs. Access Pin
Rob Graham2-May-08 3:33
Rob Graham2-May-08 3:33 
GeneralRe: SQL Query Issue: MSSQL vs. Access Pin
PDTUM2-May-08 6:02
PDTUM2-May-08 6:02 
AnswerRe: SQL Query Issue: MSSQL vs. Access Pin
Mike Dimmick2-May-08 6:02
Mike Dimmick2-May-08 6:02 
QuestionHow to calculate count? Pin
GroCareer30-Apr-08 17:25
GroCareer30-Apr-08 17:25 
AnswerRe: How to calculate count? Pin
Harini N K30-Apr-08 18:58
Harini N K30-Apr-08 18:58 
QuestionDatabase upload and Append Pin
L²+D30-Apr-08 3:24
L²+D30-Apr-08 3:24 
AnswerRe: Database upload and Append Pin
Rob Graham30-Apr-08 11:42
Rob Graham30-Apr-08 11:42 
GeneralRe: Database upload and Append Pin
L²+D1-May-08 3:21
L²+D1-May-08 3:21 
Hi Rob,
as I said, I am new to this so here is what I have done;
<br />
private bool uploadData(string myPath, string txtUpload)<br />
		{<br />
			bool bNoError = true;<br />
			string strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" +<br />
				"Data Source=" +myPath +txtUpload +";";<br />
<br />
			OleDbConnection con = new OleDbConnection(strConnection);<br />
			con.Open();<br />
			<br />
			<br />
			try<br />
			{<br />
				DataSet dsEWEtmp = new DataSet();<br />
				<br />
				OleDbDataAdapter daEWEForm = new OleDbDataAdapter("SELECT * FROM Some_Form", con);<br />
<br />
				<br />
				int updates = daEWEForm.Fill(dsEWEtmp, "Some_Form");<br />
				foreach (DataRow dataRow in dsEWEtmp.Tables)<br />
				{<br />
					dsEWEtmp.Tables[0].ImportRow(dataRow);<br />
					dsEWEtmp.Tables[0].AcceptChanges();<br />
				}<br />
<br />
				updates = daEWEForm.Update(dsEWEtmp);<br />
//				return dsEWEtmp;<br />
<br />
				DataTable tblEWEForm;<br />
				tblEWEForm = dsEWEtmp.Tables[0];<br />
			<br />
				OleDbCommandBuilder objCommandBuilder = new OleDbCommandBuilder(daEWEForm);<br />
				daEWEForm.Update(dsEWEtmp, "Some_Form");<br />
			}<br />
catch(Exception err)<br />
			{<br />
				string str = err.Message;<br />
				bNoError = false;<br />
					<br />
			}<br />
			finally<br />
			{<br />
				if (con.State.ToString() =="Open")<br />
				{<br />
					con.Close();<br />
				}<br />
			}<br />
			return bNoError;

As I stated I have the file that I upload; then if there is an uploaded file, it is "supposed" to read that file into a dataset and write it to the master database. In my web.config file, the master database resides at strConnection2, the uploaded file is at strConnection. I am really confused how to access them both, one to get the data from the uploaded file and two connect to the master database and write to it.

Is that better? Please help if you can. Thanks!Confused | :confused:

L²+D


GeneralRe: Database upload and Append Pin
Youtea1-May-08 16:36
Youtea1-May-08 16:36 
RantRe: Database upload and Append Pin
Youtea2-May-08 5:40
Youtea2-May-08 5:40 
GeneralRe: Database upload and Append Pin
L²+D2-May-08 6:41
L²+D2-May-08 6:41 
GeneralRe: Database upload and Append Pin
Rob Graham2-May-08 3:21
Rob Graham2-May-08 3:21 
GeneralRe: Database upload and Append Pin
L²+D2-May-08 5:00
L²+D2-May-08 5:00 
GeneralRe: Database upload and Append Pin
Rob Graham2-May-08 7:31
Rob Graham2-May-08 7:31 
GeneralRe: Database upload and Append Pin
L²+D6-May-08 11:14
L²+D6-May-08 11:14 
GeneralRe: Database upload and Append Pin
Rob Graham12-May-08 12:33
Rob Graham12-May-08 12:33 
QuestionMySql Connector .NET table exists Pin
annodomini230-Apr-08 2:56
annodomini230-Apr-08 2:56 
AnswerRe: MySql Connector .NET table exists Pin
Pete O'Hanlon30-Apr-08 3:27
mvePete O'Hanlon30-Apr-08 3:27 
AnswerRe: MySql Connector .NET table exists Pin
N a v a n e e t h30-Apr-08 3:34
N a v a n e e t h30-Apr-08 3:34 
GeneralRe: MySql Connector .NET table exists Pin
annodomini230-Apr-08 4:54
annodomini230-Apr-08 4:54 
GeneralRe: MySql Connector .NET table exists Pin
Pete O'Hanlon30-Apr-08 11:58
mvePete O'Hanlon30-Apr-08 11:58 
QuestionScripting SQL 2005 Database objects and Data Pin
Banjo Ayorinde29-Apr-08 22:27
Banjo Ayorinde29-Apr-08 22:27 
AnswerRe: Scripting SQL 2005 Database objects and Data Pin
Blue_Boy29-Apr-08 22:58
Blue_Boy29-Apr-08 22:58 
AnswerRe: Scripting SQL 2005 Database objects and Data Pin
Ashfield30-Apr-08 20:22
Ashfield30-Apr-08 20:22 
QuestionHow to get default databases in SQL Server 2005 Pin
VenkataRamana.Gali29-Apr-08 22:23
VenkataRamana.Gali29-Apr-08 22:23 

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.