Click here to Skip to main content
15,436,734 members
Home / Discussions / Database


QuestionEarly Binding Problem Pin
itkid17-Oct-05 5:31
Memberitkid17-Oct-05 5:31 
QuestionConverting 1000 into 10.00 Pin
hasanali0017-Oct-05 4:57
Memberhasanali0017-Oct-05 4:57 
AnswerRe: Converting 1000 into 10.00 Pin
miah alom17-Oct-05 5:44
Membermiah alom17-Oct-05 5:44 
QuestionAccess Hyperlink Field Pin
T-Smooth17-Oct-05 2:19
MemberT-Smooth17-Oct-05 2:19 
Questionsteps of configure the MySQL database in Windows XP Pin
khuchaiz16-Oct-05 13:18
Memberkhuchaiz16-Oct-05 13:18 
QuestionDataGrid Pin
kkchh16-Oct-05 4:55
Memberkkchh16-Oct-05 4:55 
AnswerRe: DataGrid Pin
miah alom17-Oct-05 5:31
Membermiah alom17-Oct-05 5:31 
GeneralRe: DataGrid Pin
Anonymous18-Oct-05 14:56
MemberAnonymous18-Oct-05 14:56 
alam_pune wrote:
string connString = @"Provider=Microsoft.JET.OLEDB.4.0;data source=C:\northwind.mdb";
string sqlString = "SELECT * FROM customers";
// Connection object
OleDbConnection connection = new OleDbConnection(connString);

// Create data adapter object
OleDbDataAdapter dataAdapter = new OleDbDataAdapter(sqlString, connection);

// Create a dataset object and fill with data using data adapter's Fill method
DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet, "customers");

// Attach dataset's DefaultView to the datagrid control
dataGrid1.DataSource = dataSet.Tables["customers"];

//no adding of new rows thru dataview...
CurrencyManager cm = (CurrencyManager)this.BindingContext[dataGrid1.DataSource, dataGrid1.DataMember];

((DataView)cm.List).AllowNew = false;


Thanks for replying. I've not tried to run your code snippet. I've a question on your code snippet that I'm not too sure (shown below). Pardon me as I'm a novice.

// Attach dataset's DefaultView to the datagrid control
dataGrid1.DataSource = dataSet.Tables["customers"];

//no adding of new rows thru dataview...
CurrencyManager cm = (CurrencyManager)this.BindingContextdataGrid1.DataSource, dataGrid1.DataMember];

((DataView)cm.List).AllowNew = false;

What's a CurrencyManager? What's the purpose of obtaining the CurrencyManager? Can I do this(shown below) instead?

DataView dv = dataSet.Tables["customers"].defaultview;
dv.AllowNew = false;
dataGrid1.DataSource = dv;

GeneralRe: DataGrid Pin
miah alom19-Oct-05 3:56
Membermiah alom19-Oct-05 3:56 
GeneralRe: DataGrid Pin
Anonymous19-Oct-05 14:34
MemberAnonymous19-Oct-05 14:34 
AnswerRe: DataGrid Pin
dwatkins@dirq.net18-Oct-05 6:01
Memberdwatkins@dirq.net18-Oct-05 6:01 
QuestionChinese antique furniture Pin
Member 236383815-Oct-05 17:03
MemberMember 236383815-Oct-05 17:03 
AnswerRe: Chinese antique furniture Pin
Colin Angus Mackay16-Oct-05 0:10
MemberColin Angus Mackay16-Oct-05 0:10 
AnswerRe: Chinese antique furniture Pin
Christian Graus16-Oct-05 12:57
mveChristian Graus16-Oct-05 12:57 
QuestionApply UNIQUE using Visual Studio.Net Pin
Aayush Puri15-Oct-05 5:05
MemberAayush Puri15-Oct-05 5:05 
Questionchecking database Pin
abhinish15-Oct-05 1:11
Memberabhinish15-Oct-05 1:11 
AnswerRe: checking database Pin
Colin Angus Mackay15-Oct-05 2:07
MemberColin Angus Mackay15-Oct-05 2:07 
GeneralRe: checking database Pin
abhinish16-Oct-05 0:01
Memberabhinish16-Oct-05 0:01 
Questionado vc++ - datetime string or numbers to variant Pin
compoundeye14-Oct-05 20:55
Membercompoundeye14-Oct-05 20:55 
Questioncomplex query Pin
Joshua Lunsford14-Oct-05 12:02
MemberJoshua Lunsford14-Oct-05 12:02 
AnswerRe: complex query Pin
Colin Angus Mackay14-Oct-05 13:14
MemberColin Angus Mackay14-Oct-05 13:14 
GeneralRe: complex query Pin
Joshua Lunsford17-Oct-05 11:49
MemberJoshua Lunsford17-Oct-05 11:49 
AnswerRe: complex query Pin
miah alom17-Oct-05 4:46
Membermiah alom17-Oct-05 4:46 
QuestionADO.NET Update / delete without primary keys Pin
Jasonc22114-Oct-05 11:10
MemberJasonc22114-Oct-05 11:10 
AnswerRe: ADO.NET Update / delete without primary keys Pin
miah alom17-Oct-05 5:52
Membermiah alom17-Oct-05 5:52 

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.