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
Zeb Rehman
NA
41
72.9k
Array Over size Problem
Dec 8 2011 5:25 PM
Hello everybody,
When i run the following code it give me the error which is also given below. I think there is problem of Array size. Can somebody please tell me how can i remove this error. My main goal is to save the value from database to array.
Thanks
using System;
using System.Data.OleDb;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace _2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
int count = 0;
string[] name = null;
string[] address = null;
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;data source=D:\\ptcl.accdb";
OleDbConnection conn = new OleDbConnection(connectionString);
string sql = "SELECT * FROM 51";
OleDbCommand cmd = new OleDbCommand(sql, conn);
{
conn.Open();
OleDbCommand com = new OleDbCommand(sql, conn);
OleDbDataReader dr = com.ExecuteReader();
while (dr.Read())
{
name[count] = dr.GetString(1).ToString();
//textBox1.Text = count.ToString() ;
//count++;
}
conn.Close();
}
}
catch (Exception ex)
{ MessageBox.Show(ex.ToString());}
}
}
}
Reply
Answers (
5
)
ETL( Extract Transform Load)
Making A Config File