|
Hi all ,
Using c# windows forms.
I have got 2 forms ; First is Main Form . Second is Report Form.
In my First Form , i have got a DataGridview Object.Im sorting selecting from db and send it to datagridview.It shows my Records. And a Button named "Report It.". Everything is OK.
In my second form , i have got a Crystral Report viewer obj.
Problem is ;
When i click "Report It" button thats in MY First Form.I want get the values from Datagridview obj. than send it to Crystal Report Obj thats in the MY Second Form and SHOW IT.!!!
its so simple isnt it ?
But i cant it. trying to do it from 2-3 weeks.
|
|
|
|
|
tr_thorn wrote: its so simple isnt it ?
Yes, it is. Read the following article: http://www.codeproject.com/dotnet/passingvaluesbetweenforms.asp[^]
You should be able to pass the datagridview object using the methods the author talks about.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
this isnt what i want .. Iam a newbie programmer i want example please.
|
|
|
|
|
tr_thorn wrote: this isnt what i want
Then what is? The article shows how to pass values from one form to another. You can extend this by passing the whole object from one form to the next using the same principles that Colin talks about.
tr_thorn wrote: Iam a newbie programmer
I am not being harsh, but it sounds like you've bit off more than you can chew at this point.
You could always make the datagridview object be public and just grab it from the second form.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
hi all,
im now doing the 'SearchEvent' using asp.net & C# on visualstudio2005,
where the user will search the event by selecting from the 3 dropdown boxes:
dropdownDay, dropdownMonth and dropdownYear.
It's suppose to query the 'start_date' from the ms access.
eg. 10-Mar-2004
im trying to write the query on it, but i kept getting the error when i run.
query:
string query = "SELECT code, description, start_date, start_time, venue FROM Event WHERE start_date = '" + dropdownDay.SelectedIndex.ToString() + " + ' - ' + " + dropdownMonth.SelectedIndex.ToString() + " + ' - ' + " + dropdownYear.SelectedIndex.ToString() + "' +";
Error message that appeared in visualstudio2005:
Syntax error (missing operator) in query expression 'start_date LIKE '%10 + ' - ' + 3 + ' - ' + 8%' +'.
i would appreciate some help on this line of code.
thanks! =D
|
|
|
|
|
your query is looking wrong
try this one
string query = "SELECT code, description, start_date, start_time, venue FROM Event WHERE start_date = '" + dropdownDay.SelectedIndex.ToString() + "' - '" + dropdownMonth.SelectedIndex.ToString() + "' - '" + dropdownYear.SelectedIndex.ToString() + "'";
Becoming Programmer...
|
|
|
|
|
thanks for the fast reply.
there isn't any error now, but i encounter some problems displaying my result in the gridview table.
when i run it, it doesn't displays any table/data at all, unlike my previous 'search by description' which is able to display out.
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source =" + Server.MapPath("myFile..mdb") + ";");
conn.Open();
string query = "SELECT code, description, start_date, start_time, venue FROM Event WHERE start_date = '" + dropdownDay.SelectedIndex.ToString() + "' - '" + dropdownMonth.SelectedIndex.ToString() + "' - '" + dropdownYear.SelectedIndex.ToString() + "'";
OleDbDataAdapter comm = new OleDbDataAdapter(query, conn);
DataSet ds = new DataSet();
comm.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
@__@ could you kindly guide me on this part?
thanks alot..
|
|
|
|
|
How can i read sqlconnection string from a text file.
|
|
|
|
|
tr_thorn wrote: How can i read sqlconnection string from a text file.
Why would you want to do that? You would typically store connection strings in the ConnectionStrings section of your app.config/web.config.
If you must read it from a text file, use the ReadAllText[^] method.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
use System.IO.File.ReadAllText or System.IO.File.ReadAllLines
hope it will help
Becoming Programmer...
|
|
|
|
|
can anyone gimme an example?
i m using windows forms c#.
|
|
|
|
|
SqlConnection dataConnection = new SqlConnection();
string connection = File.ReadAllText(filepath);
dataConnection.ConnectionString=connection;
hope it will help
Becoming Programmer...
|
|
|
|
|
|
I have a DataGrid Object and I've binded a data set to it. It works correctly but I want to change caption on column header but those is always name of field in database please help me to change it thanks.
Agh
|
|
|
|
|
May be you can change the sql used for binding...
for example,you could change "select id from user" into "select id as '<%=what you want%>' from user "...
I am not sure you get my meaning for my bad english.
My home:http://hi.baidu.com/dotnetcampus
|
|
|
|
|
hi,
I want to run a delphi application, but Just-in-time debugger of VS 2005 shows and don't permit to run it.
how can I temporarily disable it?
Best wishes
|
|
|
|
|
|
Google for the AeDebug registry key.
|
|
|
|
|
hi there,
i want to set my own size to page setup dialog before showing
for example:
i want to set size to "A4" instead of "Letter"
i tried it by this line:
pageSetupDialog1.PageSettings.PaperSize.Kind = System.Drawing.Printing.PaperKind.A4;
but it gave error that its read only
anyone know how can i do that?
thanks
Becoming Programmer...
|
|
|
|
|
How to determine programmatically if Framework 2.0 Full trust is set in trusted sites or not?
|
|
|
|
|
I'm not a CAS expert, but can you decorate a method with [PermissionSet(SecurityAction.Demand, Name = "FullTrust")], then call that method? If the method throws a security exception, you're not running in full trust.
|
|
|
|
|
there is many program that show source code in dll file. But I know you can do something to privent them to see your source code in dll file.
by the way , I cant see my comment when I create an instance of a class when I use dll file instead of source code. when I use source code( for example: class.cs) there is no problem.I can see comments. but when I use Class.dll, I cant see comment.
please guide me.
thanks
mehran
|
|
|
|
|
mohandesmehran wrote: there is many program that show source code in dll file. But I know you can do something to privent them to see your source code in dll file
Try obfuscating the dll file.
mohandesmehran wrote: I cant see my comment when I create an instance of a class when I use dll file instead of source code
What comment don't you see? The summary of the method?
I will use Google before asking dumb questions
|
|
|
|
|
yes. I cant see summary.please help me more about dll file.
thanks
|
|
|
|
|
In the compiler options somewhere is an option to generate an XML file, find it, and click it.
This will turn all your summaries and whatnot, into an XML file, which is read when you use your DLL in another project. Just remember to have the xml file in the same place as the dll.
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|