15,889,651 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by bora1891 (Top 13 by date)
bora1891
7-Oct-15 8:48am
View
Thank you for reply.
But I think I cannot get the "Class" name. If i get the class name (like when i write the class name statistically as an input) this part will work:
public class LINQDynamic<-TEntity-> where TEntity: class
{
public static object GetQueryResult(object pkKey,Type type, params object[] pkKeys)
{
//TODO
}
So I am even not sure that I can get the class name from table type.And maybe I make some conversition type to real class but I don't know how to make and I'm notsure this is possible becasue my entityType is dynamic.
The LINQDynamic, wait a class.
bora1891
7-Oct-15 2:45am
View
My problem is here;
var test = LINQDynamic<-?->.GetQueryResult();
which is the question mark.I want to pass my Type which is entityTpe.Is there a way to pass my entityType variable?
bora1891
13-Oct-14 7:29am
View
Ok sinisa,thxs for interesting my subject
bora1891
12-Oct-14 7:52am
View
Sinisa,
Can you give any code to understand well?
And maybe you gave the code solves my problem :)
bora1891
10-Oct-14 8:59am
View
I want to transfer into the another grid.But the grid has the other form.
And I tried your suggestion but I get an error.The Error message in the error list;
'object' does not contain a definition for 'Checked' and no extension method 'Checked' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?).
Can you explain to me your this suggestion I don't know this way :/
Like this:
foreach loop
newGrid.DataSource.ImportRow(originalGridRow) -- ImportRow is DataTable method so you'll need to cast accordingly
bora1891
10-Oct-14 6:39am
View
Hajnal,yes I mean tranfer selected rows.
My problem is to transfer data by multiple selection.For example, users makes multiple selection with checkboxes in the table and that you have selected the rows in the DataGrid will show in another form Datagrid in WindowsForms.So I used this code to transfer data from another form's datagrid.I succeed it but I didn't multiple transfer data.This is my code of transfer data.
Int32 ID = Convert.ToInt32(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[1].Value.ToString());
MessageBox.Show("ID" + ID);
DataTable table = new DataTable();
using (SqlConnection conn = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Dorana.mdf;Integrated Security=True;User Instance=True;Pooling=False"))
{
string SQL = @"Select * from rezerve Where ( rezerveID = @rzveID);";
SqlCommand cmd = new SqlCommand(SQL, conn);
cmd.Parameters.AddWithValue("@rzveID", ID);
conn.Open();
table.Load(cmd.ExecuteReader());
conn.Close();
}
rzve rzrv= new rzve();
// DataGridView dgv1 = new DataGridView { Dock = DockStyle.Fill };
rzrv.Controls.Add(dataGridView1);
rzrv.dataGridView1.DataSource = table;
rzrv.Show();
rzrv.dataGridView1.Columns["name"].HeaderText = "Name";
rzrv.dataGridView1.Columns["surname"].HeaderText = "Surname";
rzrv.dataGridView1.Columns["gender"].HeaderText = "Gender";
rzrv.dataGridView1.Columns["date"].HeaderText = "Date";
bora1891
10-Oct-14 5:04am
View
Thnxs for all but I tried your solution and I didn't solve my problem.I think my problem is ID..When I use ID in my query,program always will be accept the last selection because I select more than one rows with checkboxes but it will accept the last one how can I solve my problem ?..Please give an suggestion
Again thnxs for your help :)
bora1891
10-Oct-14 5:03am
View
Thnxs for all but I tried your solution and I didn't solve my problem.I think my problem is ID..When I use ID in my query,program always will be accept the last selection because I select more than one rows with checkboxes but it will accept the last one how can I solve my problem ?..Please give an suggestion
Again thnxs for your help :)
bora1891
9-Oct-14 20:10pm
View
how can I solve this problem?..And which can be use the query to transfer more than one rows,what is my mistake?..Please help mee :)..Sorry about to my answer I will not to write any more in the solution section ;)
bora1891
9-Oct-14 9:12am
View
I use this code but I didn't transfer more than one row when I select 2 rows code will be accept the last one and show the last one in the datagridview
Int32 ID = Convert.ToInt32(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[1].Value.ToString());
MessageBox.Show("ID" + ID);
DataTable table = new DataTable();
using (SqlConnection conn = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Dorana.mdf;Integrated Security=True;User Instance=True;Pooling=False"))
{
string SQL = @"Select * from rezerve Where ( rezerveID = @rzveID);";
SqlCommand cmd = new SqlCommand(SQL, conn);
cmd.Parameters.AddWithValue("@rzveID", ID);
conn.Open();
table.Load(cmd.ExecuteReader());
conn.Close();
}
rzve rzrv= new rzve();
// DataGridView dgv1 = new DataGridView { Dock = DockStyle.Fill };
rzrv.Controls.Add(dataGridView1);
rzrv.dataGridView1.DataSource = table;
rzrv.Show();
rzrv.dataGridView1.Columns["name"].HeaderText = "Name";
rzrv.dataGridView1.Columns["surname"].HeaderText = "Surname";
rzrv.dataGridView1.Columns["gender"].HeaderText = "Gender";
rzrv.dataGridView1.Columns["date"].HeaderText = "Date";
bora1891
9-Oct-14 8:57am
View
Deleted
I use this code but I didn't transfer more than one row when I select 2 rows code will be accept the last one and show the last one in the datagridview
I use this code but I didn't transfer more than one row when I select 2 rows code will be accept the last one and show the last one in the datagridview
Int32 ID = Convert.ToInt32(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[1].Value.ToString());
MessageBox.Show("ID" + ID);
DataTable table = new DataTable();
using (SqlConnection conn = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Dorana.mdf;Integrated Security=True;User Instance=True;Pooling=False"))
{
string SQL = @"Select * from rezerve Where ( rezerveID = @rzveID);";
SqlCommand cmd = new SqlCommand(SQL, conn);
cmd.Parameters.AddWithValue("@rzveID", ID);
conn.Open();
table.Load(cmd.ExecuteReader());
conn.Close();
}
rzve rzrv= new rzve();
// DataGridView dgv1 = new DataGridView { Dock = DockStyle.Fill };
rzrv.Controls.Add(dataGridView1);
rzrv.dataGridView1.DataSource = table;
rzrv.Show();
rzrv.dataGridView1.Columns["name"].HeaderText = "Name";
rzrv.dataGridView1.Columns["surname"].HeaderText = "Surname";
rzrv.dataGridView1.Columns["gender"].HeaderText = "Gender";
rzrv.dataGridView1.Columns["date"].HeaderText = "Date";
bora1891
9-Oct-14 8:27am
View
Sorry,I forgot to write which forms..I work in c# winforms and my database is sql..
bora1891
5-Aug-14 7:01am
View
ServiceController myService = new ServiceController();
myService.ServiceName = "ImapiService";
string svcStatus = myService.Status.ToString();
if (svcStatus == "Running"){
myService.Stop();
myService.Refresh();
myService.Start();
}
if My code change like this the error will be at myService.Start(); and error is:Cannot start service MSSQL$SQLEXPRESS on computer.
but if my code like this
ServiceController myService = new ServiceController();
myService.ServiceName = "ImapiService";
string svcStatus = myService.Status.ToString();
if (svcStatus == "Running"){
myService.Stop();
myService.Refresh();
}
string svcStatu = myService.Status.ToString();
if (svcStatu == "Stopped"){
myService.Start();
myService.Refresh();
}
program will not to step into second if statement.. why?
Show More