Click here to Skip to main content
15,921,028 members
Home / Discussions / Database
   

Database

 
GeneralRe: Normalization question Pin
slvrscremr9-Aug-04 3:57
slvrscremr9-Aug-04 3:57 
GeneralRe: Normalization question Pin
slvrscremr9-Aug-04 4:09
slvrscremr9-Aug-04 4:09 
GeneralRe: Normalization question Pin
Steven Campbell9-Aug-04 10:26
Steven Campbell9-Aug-04 10:26 
GeneralThreads in stored procedures Pin
Member 2866418-Aug-04 19:54
Member 2866418-Aug-04 19:54 
QuestionOptimezed use ADO.Net? Pin
rbarzallo7-Aug-04 6:58
rbarzallo7-Aug-04 6:58 
AnswerRe: Optimezed use ADO.Net? Pin
slvrscremr9-Aug-04 3:23
slvrscremr9-Aug-04 3:23 
GeneralORACLE / ADO .NET: TNS: Packet Writer Failure in parameterized query Pin
slvrscremr6-Aug-04 8:18
slvrscremr6-Aug-04 8:18 
GeneralMultiple Excel files Pin
janigorse6-Aug-04 7:58
janigorse6-Aug-04 7:58 
I'm working on application, that will recive multiple Excel files
and displaing it in a DataGrid.

The problem is, that when I select 2 or 3 files from OpenDialog, it
displays only the data from the first selected file, the other values
in DataGrid are null values. Why is that? And how can I solve this, that
the DataGrid will display all values. Thank you.

Here is the code:

private void btnOpen_Click(object sender, System.EventArgs e)<br />
{<br />
  try<br />
	{<br />
	       Stream myStream;<br />
	       OpenFileDialog openFileDialog1 = new OpenFileDialog();<br />
	        // set up file dialog properties<br />
		openFileDialog1.InitialDirectory = "E:\\" ;<br />
		openFileDialog1.Filter = "txt files (*.txt)|*.txt|Allfiles(*.*)|*.*" ;<br />
		openFileDialog1.FilterIndex = 2 ;<br />
		openFileDialog1.RestoreDirectory = true ;<br />
		openFileDialog1.Multiselect = true;<br />
<br />
		if(openFileDialog1.ShowDialog() == DialogResult.OK)<br />
			{<br />
				if((myStream = openFileDialog1.OpenFile())!= null)<br />
				{<br />
					// Insert code to read the stream here.<br />
		//					string strFileName = openFileDialog1.FileName;<br />
				DataSet ds = new DataSet();<br />
<br />
						foreach (string strFileName in openFileDialog1.FileNames)<br />
						{<br />
			<br />
							string connStr = <br />
								@"Driver={Microsoft Excel Driver (*.xls)};DBQ=" + strFileName;<br />
							<br />
							string sql = "SELECT * FROM [Sheet1$]";<br />
							OdbcDataAdapter adapter = new OdbcDataAdapter(sql,connStr);<br />
							adapter.Fill(ds,"[Sheet1$]");<br />
							<br />
						}<br />
						gridPorocila.DataMember = "[Sheet1$]";<br />
						gridPorocila.DataSource = ds.DefaultViewManager;<br />
<br />
						myStream.Close();<br />
					}<br />
				}<br />
				<br />
			}<br />
			catch (Exception ex)<br />
			{<br />
				MessageBox.Show(ex.Message.ToString());<br />
			}<br />
<br />
		}

GeneralRe: Multiple Excel files Pin
Anonymous16-Aug-04 20:26
Anonymous16-Aug-04 20:26 
Generalbackup access database Pin
sungsunpark6-Aug-04 5:47
sungsunpark6-Aug-04 5:47 
GeneralRe: backup access database Pin
RichardGrimmer12-Aug-04 1:32
RichardGrimmer12-Aug-04 1:32 
GeneralSearching problem (serious!) Pin
RoyRose786-Aug-04 1:03
RoyRose786-Aug-04 1:03 
GeneralRe: Searching problem (serious!) Pin
Michael Potter6-Aug-04 4:21
Michael Potter6-Aug-04 4:21 
GeneralRe: Searching problem (serious!) Pin
RoyRose786-Aug-04 4:57
RoyRose786-Aug-04 4:57 
GeneralMultiple Conditionals Pin
Peter86753095-Aug-04 8:43
Peter86753095-Aug-04 8:43 
GeneralRe: Multiple Conditionals Pin
Mike Ellison5-Aug-04 13:11
Mike Ellison5-Aug-04 13:11 
GeneralRe: Multiple Conditionals Pin
EdbertP5-Aug-04 13:27
EdbertP5-Aug-04 13:27 
GeneralRe: Multiple Conditionals Pin
Peter86753099-Aug-04 4:57
Peter86753099-Aug-04 4:57 
GeneralMS SQL 7 Error Pin
payal sheth5-Aug-04 2:51
payal sheth5-Aug-04 2:51 
Generalcomparing memo fields in Access Pin
pankajdaga4-Aug-04 23:47
pankajdaga4-Aug-04 23:47 
GeneralCreating db table from DataTable Pin
matt cole3-Aug-04 2:23
matt cole3-Aug-04 2:23 
GeneralRe: Creating db table from DataTable Pin
Thea Burger3-Aug-04 3:09
Thea Burger3-Aug-04 3:09 
GeneralRe: Creating db table from DataTable Pin
matt cole3-Aug-04 19:08
matt cole3-Aug-04 19:08 
Generalhide relation in parent table Pin
Anonymous2-Aug-04 23:43
Anonymous2-Aug-04 23:43 
Questionhow to connect Oracle Lite Database with ADO.NET ? Pin
manoj_mevada2-Aug-04 22:29
manoj_mevada2-Aug-04 22:29 

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.