Click here to Skip to main content
15,913,685 members
Home / Discussions / C#
   

C#

 
Questionstooopid problem with my connection:( Pin
Muammar©8-Dec-06 23:26
Muammar©8-Dec-06 23:26 
QuestionMDI - Question Pin
h@s@n8-Dec-06 21:10
h@s@n8-Dec-06 21:10 
AnswerRe: MDI - Question Pin
Muammar©8-Dec-06 21:26
Muammar©8-Dec-06 21:26 
QuestionClasses of .NET Framework Pin
wanlim08178-Dec-06 20:50
wanlim08178-Dec-06 20:50 
AnswerRe: Classes of .NET Framework Pin
Michael P Butler8-Dec-06 21:02
Michael P Butler8-Dec-06 21:02 
GeneralRe: Classes of .NET Framework Pin
wanlim08178-Dec-06 21:51
wanlim08178-Dec-06 21:51 
GeneralRe: Classes of .NET Framework Pin
Michael P Butler8-Dec-06 22:10
Michael P Butler8-Dec-06 22:10 
QuestionHow To Move Record Pointer Of DataGridView Using Code In C# Pin
Sonal Satpute8-Dec-06 19:54
Sonal Satpute8-Dec-06 19:54 
Hi Friends,
i want to move the record pointer of DataGridView using code in C#.
i m trying BindingMangerBase but the problem is this only passion of bmb changing but the record pointer of dgv is not moving.

:-Dthe same is working fine with VB.NET. this is a code of VB.NET
Public Class frmTest
    Dim bmb As BindingManagerBase
    Dim bs As New BindingSource
    Private Sub frmTest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        connDB()
    End Sub

    Private Sub connDB()
        Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0; Data Source = D:\TEMP\TestADO\DB\db1.mdb;")
        Dim da As New OleDbDataAdapter("Select * From tblAdd;", cn)
        Dim dt As New DataTable
        Dim ds As New DataSet
        da.Fill(dt)
        bs.DataSource = dt
        dgv.DataSource = bs
        bmb = BindingContext(bs)
    End Sub


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        bmb.Position = 0
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        bmb.Position = bmb.Position + 1
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        bmb.Position = bmb.Position - 1
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        bmb.Position = bmb.Count - 1
    End Sub
End Class


Frown | :( here is the code of C# which is not working fine

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace testBindings
{
    public partial class Form1 : Form
    {
        private SqlConnection conn ;
        private SqlDataAdapter da;
        private DataSet ds;
        public BindingSource bs;
        public BindingManagerBase bmb;

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            conn = new SqlConnection ("Data Source=myhome\\sqlexpress;Initial Catalog=ChickenPeoxX;Integrated Security=True");
            da= new SqlDataAdapter ("select * from tblGroup;",conn );
            ds= new DataSet ();
            da.Fill(ds,"GROUP");
            dgv.DataSource = ds.Tables[0];//,"GROUP"];
            bs = new BindingSource( );             
            bmb = BindingContext[bs]; 
            bs.DataSource  = ds.Tables[0];//"GROUP"]; 
         }

        private void button1_Click(object sender, EventArgs e)
        {
            bmb.Position = bmb.Position+ 1;
            textBox1.Text = bmb.Position.ToString() ;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            bmb.Position = bmb.Position-1;
            textBox1.Text = bmb.Position.ToString();
        }
    }
}:(


please help me with this ...

thnX in Advance

Regards
Sonal


.::HuNTeR::.

QuestioncheckedListBox item showing unreliable behaviour Pin
Saira Tanwir8-Dec-06 19:49
Saira Tanwir8-Dec-06 19:49 
AnswerRe: checkedListBox item showing unreliable behaviour Pin
Parwej Ahamad8-Dec-06 21:22
professionalParwej Ahamad8-Dec-06 21:22 
QuestionWhere to put the password? Pin
Nader Elshehabi8-Dec-06 18:10
Nader Elshehabi8-Dec-06 18:10 
AnswerRe: Where to put the password? Pin
Muammar©8-Dec-06 22:52
Muammar©8-Dec-06 22:52 
AnswerRe: Where to put the password? Pin
Dario Solera8-Dec-06 23:30
Dario Solera8-Dec-06 23:30 
GeneralRe: Where to put the password? Pin
Nader Elshehabi8-Dec-06 23:53
Nader Elshehabi8-Dec-06 23:53 
GeneralRe: Where to put the password? Pin
Dario Solera9-Dec-06 0:02
Dario Solera9-Dec-06 0:02 
GeneralRe: Where to put the password? Pin
Nader Elshehabi9-Dec-06 0:22
Nader Elshehabi9-Dec-06 0:22 
QuestionCreate Graphics?? Pin
azusakt8-Dec-06 17:23
azusakt8-Dec-06 17:23 
AnswerRe: Create Graphics?? Pin
Nader Elshehabi8-Dec-06 18:17
Nader Elshehabi8-Dec-06 18:17 
AnswerRe: Create Graphics?? Pin
DavidNohejl10-Dec-06 4:36
DavidNohejl10-Dec-06 4:36 
AnswerRe: Create Graphics?? Pin
Nader Elshehabi10-Dec-06 9:42
Nader Elshehabi10-Dec-06 9:42 
GeneralRe: Create Graphics?? Pin
DavidNohejl10-Dec-06 10:55
DavidNohejl10-Dec-06 10:55 
GeneralRe: Create Graphics?? Pin
Nader Elshehabi10-Dec-06 11:41
Nader Elshehabi10-Dec-06 11:41 
AnswerRe: Create Graphics?? Pin
DavidNohejl10-Dec-06 4:30
DavidNohejl10-Dec-06 4:30 
GeneralRe: Create Graphics?? Pin
azusakt13-Dec-06 15:17
azusakt13-Dec-06 15:17 
QuestionP/Invoke call to external DLL Pin
Patrick Schmid8-Dec-06 17:12
Patrick Schmid8-Dec-06 17:12 

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.