Click here to Skip to main content
15,887,746 members
Home / Discussions / C#
   

C#

 
AnswerRe: trying to use stored proc @fields in winforms with sql connection. Error procedure or function @Field expects parameter... Pin
Richard Deeming21-Oct-14 8:47
mveRichard Deeming21-Oct-14 8:47 
AnswerRe: trying to use stored proc @fields in winforms with sql connection. Error procedure or function @Field expects parameter... Pin
PIEBALDconsult21-Oct-14 9:10
mvePIEBALDconsult21-Oct-14 9:10 
GeneralRe: trying to use stored proc @fields in winforms with sql connection. Error procedure or function @Field expects parameter... Pin
Sam 910021-Oct-14 9:53
Sam 910021-Oct-14 9:53 
GeneralRe: trying to use stored proc @fields in winforms with sql connection. Error procedure or function @Field expects parameter... Pin
PIEBALDconsult21-Oct-14 10:04
mvePIEBALDconsult21-Oct-14 10:04 
GeneralRe: trying to use stored proc @fields in winforms with sql connection. Error procedure or function @Field expects parameter... Pin
Sam 910021-Oct-14 11:38
Sam 910021-Oct-14 11:38 
GeneralRe: trying to use stored proc @fields in winforms with sql connection. Error procedure or function @Field expects parameter... Pin
PIEBALDconsult21-Oct-14 11:48
mvePIEBALDconsult21-Oct-14 11:48 
Answerproblem with multicolumncombo and bindingnavigator movenext ,... Pin
fatemehsoleimani21-Oct-14 4:58
fatemehsoleimani21-Oct-14 4:58 
AnswerRe: problem with multicolumncombo and bindingnavigator movenext ,... Pin
fatemehsoleimani21-Oct-14 21:43
fatemehsoleimani21-Oct-14 21:43 
my problem resolved
my code:
[php]
private void Form2_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'phonebookDataSet.moshtarakin_hoghoghi' table. You can move, or remove it, as needed.
this.moshtarakin_hoghoghiTableAdapter.Fill(this.phonebookDataSet.moshtarakin_hoghoghi);

SqlConnection ConSub = new SqlConnection("Data Source=.;Initial Catalog=phonebook;Integrated Security=True");
ConSub.Open();
SqlDataAdapter Adapter = new SqlDataAdapter("Select * from State", ConSub);
DataTable State = new DataTable();
Adapter.Fill(State);
multiColumnCombo1.DataSource = State;

Adapter.SelectCommand.Connection = ConSub;
Adapter.SelectCommand.CommandText = "Select * from StateCity where State_Id='" + Convert.ToInt32(multiColumnCombo1.Value.ToString()) + "'";
DataTable StateCity = new DataTable();
Adapter.Fill(StateCity);
multiColumnCombo2.DataSource = StateCity;

Adapter.SelectCommand.Connection = ConSub;
Adapter.SelectCommand.CommandText = "Select * from groh";
DataTable groh = new DataTable();
Adapter.Fill(groh);
multiColumnCombo3.DataSource = groh;

Adapter.SelectCommand.Connection = ConSub;
Adapter.SelectCommand.CommandText = "Select * from activity where code_groh='" + Convert.ToInt32(multiColumnCombo3.Value.ToString()) + "'";
DataTable activity = new DataTable();
Adapter.Fill(activity);
multiColumnCombo4.DataSource = activity;

}

private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)
{
moshtarakinhoghoghiBindingSource.AddNew();
if (phonebookDataSet.moshtarakin_hoghoghi.Compute("max(SysCode)+1", null).ToString() != null)
editBox1.Text = phonebookDataSet.moshtarakin_hoghoghi.Compute("max(SysCode)+1", null).ToString();
else
editBox1.Text = 1.ToString();
editBox3.Text = "";
editBox2.Text = "";
editBox4.Text = "";
multiColumnCombo1.Text = "";
multiColumnCombo2.Text = "";
multiColumnCombo3.Text = "";
multiColumnCombo4.Text = "";
uiComboBox1.Text = "";
}

private void multiColumnCombo1_TextChanged(object sender, EventArgs e)
{
if (multiColumnCombo1.Text != "")
{
SqlConnection ConSub = new SqlConnection("Data Source=.;Initial Catalog=phonebook;Integrated Security=True");
ConSub.Open();
SqlDataAdapter Adapter = new SqlDataAdapter("", ConSub);
Adapter.SelectCommand.Connection = ConSub;
Adapter.SelectCommand.CommandText = "Select * from StateCity where State_Id='" + Convert.ToInt32(multiColumnCombo1.Value.ToString()) + "'";
DataTable StateCity = new DataTable();
Adapter.Fill(StateCity);
multiColumnCombo2.DataSource = StateCity;
}
}

private void multiColumnCombo3_TextChanged(object sender, EventArgs e)
{
if (multiColumnCombo3.Text != "")
{
SqlConnection ConSub = new SqlConnection("Data Source=.;Initial Catalog=phonebook;Integrated Security=True");
ConSub.Open();
SqlDataAdapter Adapter = new SqlDataAdapter("", ConSub);
Adapter.SelectCommand.Connection = ConSub;
Adapter.SelectCommand.CommandText = "Select * from activity where code_groh='" + Convert.ToInt32(multiColumnCombo3.Value.ToString()) + "'";
DataTable activity = new DataTable();
Adapter.Fill(activity);
multiColumnCombo4.DataSource = activity;
}
}

private void toolStripButton1_Click(object sender, EventArgs e)
{
try
{
moshtarakinhoghoghiBindingSource.EndEdit();
moshtarakin_hoghoghiTableAdapter.Update(this.phonebookDataSet.moshtarakin_hoghoghi);
}
catch
{
}
}

private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
{
if (moshtarakinhoghoghiBindingSource.Count > 0)
moshtarakinhoghoghiBindingSource.RemoveCurrent();
moshtarakinhoghoghiBindingSource.EndEdit();
moshtarakin_hoghoghiTableAdapter.Update(this.phonebookDataSet.moshtarakin_hoghoghi);
}
[/php]
QuestionHow to trigger coded UI tests from C# code or can I draft mstest commands and trigger through process.start? Pin
vinod chattergee21-Oct-14 1:06
vinod chattergee21-Oct-14 1:06 
AnswerRe: How to trigger coded UI tests from C# code or can I draft mstest commands and trigger through process.start? Pin
Eddy Vluggen21-Oct-14 6:10
professionalEddy Vluggen21-Oct-14 6:10 
GeneralRe: How to trigger coded UI tests from C# code or can I draft mstest commands and trigger through process.start? Pin
vinod chattergee23-Oct-14 19:18
vinod chattergee23-Oct-14 19:18 
GeneralRe: How to trigger coded UI tests from C# code or can I draft mstest commands and trigger through process.start? Pin
Eddy Vluggen24-Oct-14 1:35
professionalEddy Vluggen24-Oct-14 1:35 
QuestionImplementing SSO using SAML, C# Pin
shank07ct21-Oct-14 1:05
shank07ct21-Oct-14 1:05 
AnswerRe: Implementing SSO using SAML, C# Pin
OriginalGriff21-Oct-14 2:35
mveOriginalGriff21-Oct-14 2:35 
AnswerRe: Implementing SSO using SAML, C# Pin
Richard MacCutchan21-Oct-14 2:47
mveRichard MacCutchan21-Oct-14 2:47 
QuestionC# assign ProcessID Pin
Alaric_20-Oct-14 10:56
professionalAlaric_20-Oct-14 10:56 
AnswerRe: C# assign ProcessID Pin
Ravi Bhavnani20-Oct-14 11:33
professionalRavi Bhavnani20-Oct-14 11:33 
GeneralRe: C# assign ProcessID Pin
Alaric_20-Oct-14 15:34
professionalAlaric_20-Oct-14 15:34 
AnswerRe: C# assign ProcessID Pin
Member 9986689 (PandaLion98)25-Oct-14 21:13
professionalMember 9986689 (PandaLion98)25-Oct-14 21:13 
GeneralRe: C# assign ProcessID Pin
Alaric_28-Oct-14 10:11
professionalAlaric_28-Oct-14 10:11 
QuestionWhat is better way to organise code of big project Pin
Member 1115157120-Oct-14 5:08
Member 1115157120-Oct-14 5:08 
AnswerRe: What is better way to organise code of big project Pin
Simon_Whale20-Oct-14 5:15
Simon_Whale20-Oct-14 5:15 
AnswerRe: What is better way to organise code of big project Pin
PIEBALDconsult20-Oct-14 5:16
mvePIEBALDconsult20-Oct-14 5:16 
AnswerRe: What is better way to organise code of big project Pin
Eddy Vluggen20-Oct-14 5:23
professionalEddy Vluggen20-Oct-14 5:23 
AnswerRe: What is better way to organise code of big project Pin
OriginalGriff20-Oct-14 5:31
mveOriginalGriff20-Oct-14 5:31 

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.