|
Hi...
Well, I'd typed the query out in a notepad file, and I guess when I saw it, I forgot the second day that I'd already posted it the previous day... sorry about that. Don't be upset , I didn't mean to spam the message board. It was a mistake, honest .
And I responded to your original reply now...
Maybe we should close this thread, and use only the original one... how do I do that?
Thanks (and sorry),
Tunçay Şanlı
|
|
|
|
|
Is there any code to stream a video file and play it over the internet?
|
|
|
|
|
Wrong forum. This is for C# questions.
(There's loads of ways. Here's one: http://flowplayer.org/[^] Google for more.)
Simon
|
|
|
|
|
|
|
hello,
i try to learn the 3tier-architecture
But there are a few question:
1.How can i fill a datagridview in my UI.
the grid should be filled by a dataset.
user can change the data in the grid.
How could this be realized ?
a) The DAL returns a dataset to the BAL and the BAL forwards the dataset to the UI?
b) The DAL returns a datatable to the BAL and the BAL creates a dataset and forwards it to the UI?
c) other?
2.How can i update the database ?
That should be realized with the DataAdapter, right?
bye jogi
|
|
|
|
|
The whole thing of separating the layers is about not letting the UI know that there is such a thing as a datalayer and vice versa. Thus, your question (the grid should be filled by a dataset) is misleading. A grid shouldn't be aware of the concept 'dataset' at all.
(I know that it is not always done this strict way, but then it is no proper 3tier architecture...)
Rather you have your BAL communicate with the DAL exclusively, and your UI is only allowed to talk with the BAL, not with the DAL.
Example:
You have a db table, say CUSTOMERS .
In your BL, you have a related business object, a Customer class. Additionally you have a class that gives the illusion of an in-memory collection of all customers, say CustomerRepository , that is used to access certain Customer objects or collections of them on demand. Internally, this CustomerRepository is using the DAL to persist your data.
The DAL is the layer used for mediating between your CUSTOMERS table and the Customer class.
Now, in your GUI, you can fill your grid with Customer instances instead of dataset rows.
Regards
Thomas
www.thomas-weller.de
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Programmer - an organism that turns coffee into software.
|
|
|
|
|
Hi Thomas,
thanks for your help.
I made it like you described.
Now i have a list(List<customer>) of customers (like your example) in my grid.
How can i write the changed Data from the grid back to the DAL ?
Can i Update the grid in one Step ?
Or do i have to get the changed rows and update every changed row per code ?
bye jogi
|
|
|
|
|
Well, I assume that your grid and your Customer instances are automatically kept in sync all the time (you can achieve this by simply databinding your Customers collection to the grid - each property to its respective column). So it's a matter of how to persist the changed/new/deleted Customer instances from the BL to the db.
The DAL is responsible for updating/creating/deleting Customers , the BL has to maintain the necessary information. There are two approaches to the question How is the necessary information hold?: (1) It can be stored in the business object itself or (2) the Repository can maintain respective lists. In the first case the business objects would have each a Dirty and a Deleted property (New can normally be seen from the fact that new objects have no ID yet...), in the second the respective repository would maintain lists of changed/new/deleted objects. The second approach is the cleaner one, since in this case the business objects do not expose persistence related stuff at all. It's also faster, if you have to manage very large lists.
So, in our example, it would go like this:
The user changes sth. in the grid, e.g. a Customers firstname from 'John' to 'Mike'.
This changes the related Customer instances Firstname property respectively. Inside this property setter, either an internal Dirty-Flag is set to true (1) or the Customer instance tells its Repository that it has been changed (2).
Now the User clicks on the Save button, which would result in a call to CustomerRepository.SaveAll or sth. similar. SaveAll would cause the repository to go through the list of Customers and save/delete/create all as indicated by their respective properties (1), or the repository would ask its own internal lists to do this (2). The repository then calls the DAL to do the persistence stuff, wrapped inside a db transaction.
Regardless of the exact implementation details, the UI simply calls SaveAll , and that's it. It is totally agnostic of what goes on behind the scenes.
(Often, an object-relational mapper (like e.g. NHibernate or MS Entity Framework, to name just two) is used to automate all this persistence stuff like keeping DB and BL in sync, caching etc. Admittedly, it's a bit complicated to learn, but it pays. This article on CP might give you a good overall picture, if you are willing to invest some time and effort: NHibernate Best Practices with ASP.NET, 1.2nd Ed.[^])
Regards
Thomas
www.thomas-weller.de
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Programmer - an organism that turns coffee into software.
|
|
|
|
|
Hi Guys,
I can log msg in event log in my local computer. I want to do the same remotely...
I find MachineName property in EventLog class, but didn't work...
Your help could be useful.
Following is my code snippet:
EventLog sysLog=new EventLog();
sysLog.MachineName="00C0D0C10F4A";
if(!EventLog.SourceExists("Application-1"))
EventLog.CreateEventSource("Application-1","SystemLog");
EventLog.WriteEntry("Application-1","Hi",EventLogEntryType.Warning,235);
thax
Thanks,
Chintan(India)
|
|
|
|
|
Try to using WMI. It will be very easy !!
cheers,
Abhijit
|
|
|
|
|
is there any other event rather than Datagridview _EditingControlShowing which e.control need to be cast to combobox type
sadara
|
|
|
|
|
Hello all, Here is my scenario.
1. Client App (Smart/Web) installed on Machine A.
2. Remoting Object is hosted in IIS on Machine A or B.
I need to create a unit testing (am using NUnit , but that doesn't matter i guess), where client makes a call and transfers some data in call context. Request hits IIS/Remoting object and based on information in call context server does something.
1. Unit testing for Client components , whether it is sending right information, is easy just call components of client.
2. I need to test whether the same data is properly available to server (transported properly to server) and processed it. I am not sure how to proceed and create a scenario Remoting (hosted in IIS) and server Unit Test components.
Something like Client->Remoting object on IIS->Server process request.
Any suggestions greatly appreciated. (Am using HTTPChannel for remoting)
Thanks.
|
|
|
|
|
Hi friends,
What is maximum size of data we can write to port & read from port?
Is there any limit to it?
Reagards
Shiva
|
|
|
|
|
if you use System.IO.Ports.SerialPort component the maximum size of data to read = SerialPort.ReadBufferSize and maximum size of data to write = SerialPort.WriteBufferSize. But you can adjust them as necessary.
The ReadBufferSize property default 4096 ignores any value smaller than 4096.
The WriteBufferSize property default 2048.
i don't know the maximum limit, but i think is Int32.MaxValue
any ideas?
dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support
|
|
|
|
|
hi friends
I have created one ssis package using interface, it works fine
flow is like
oledbdatasource ->
conditional splits like
--> if action = 1 then oledb command 1 -> oledbcommand2
if action = 2 then oledb command 3 -> oledbcommand4
default output of conditional split
to oledb destination
i want to do this using C#.
all the components like conditional split and oledbcommand should be add on the fly.
any one can give me a hint or url for this.
thanks so much
|
|
|
|
|
i want to create report with report viewer and then came up this error at runtime
here is my code
inventoryInfoReport.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local; inventoryInfoReport.LocalReport.ReportPath = CitronConfiguration.ReportPath + "InventoryInfoReport.rdlc";
InventoryInfoDataSet inventoryDataSetObj = new InventoryInfoDataSet();
IList<inventorycatalog> inventoryCatalogList = new InventoryCatalogSystem().GetInventoryCatalogList();
foreach (InventoryCatalog inventoryCatalog in inventoryCatalogList)
{
DataRow row = inventoryDataSetObj.Tables[0].NewRow();
row["InventoryId"] = inventoryCatalog.InventoryId;
row["InventoryName"] = inventoryCatalog.InventoryName;
row["Stock"] = Library.DecimalToCurrency(inventoryCatalog.Stock);
row["IdealStock"] = Library.DecimalToCurrency(inventoryCatalog.IdealStock);
row["Balance"] = Library.DecimalToCurrency(inventoryCatalog.Balance);
inventoryDataSetObj.Tables[0].Rows.Add(row);
}
ReportDataSource objDataSource = new ReportDataSource("InventoryInfoDataSet_DataTable1", inventoryDataSetObj.Tables[0]);
inventoryInfoReport.LocalReport.DataSources.Add(objDataSource); <--the error was here
can some one help me please?
|
|
|
|
|
Which line blows up ? I assume you're mixing types and need to do some sort of conversion somewhere.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
inventoryInfoReport.LocalReport.DataSources.Add(objDataSource); <--the error was at this line
i use report viewer, C#.NET with Gizmox, and i can't figure out what i've done wrong because until this part
ReportDataSource objDataSource = new ReportDataSource("InventoryInfoDataSet_DataTable1", inventoryDataSetObj.Tables[0]); <- this one
inventoryInfoReport.LocalReport.DataSources.Add(objDataSource); <--the error was at this line
i can see the data table clearly it shows all the data that i want to show on the report viewer, but when i hit F10 to the next line, it shows error like this "Attempted to access an element as a type incompatible with the array", i've checked my previous code i don't see any differences to this one, but how come this one is error, can u tell me why?
|
|
|
|
|
OK, what code runs when the data is bound ? Id assume the issue is the types of the objects in the datasource.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
inventoryInfoReport.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local; inventoryInfoReport.LocalReport.ReportPath = CitronConfiguration.ReportPath + "InventoryInfoReport.rdlc";
InventoryInfoDataSet inventoryDataSetObj = new InventoryInfoDataSet();
IList<inventorycatalog> inventoryCatalogList = new InventoryCatalogSystem().GetInventoryCatalogList();
foreach (InventoryCatalog inventoryCatalog in inventoryCatalogList)
{
DataRow row = inventoryDataSetObj.Tables[0].NewRow();
row["InventoryId"] = inventoryCatalog.InventoryId;
row["InventoryName"] = inventoryCatalog.InventoryName;
row["Stock"] = Library.DecimalToCurrency(inventoryCatalog.Stock);
row["IdealStock"] = Library.DecimalToCurrency(inventoryCatalog.IdealStock);
row["Balance"] = Library.DecimalToCurrency(inventoryCatalog.Balance);
inventoryDataSetObj.Tables[0].Rows.Add(row);
}
ReportDataSource objDataSource = new ReportDataSource("InventoryInfoDataSet_DataTable1", inventoryDataSetObj.Tables[0]); <- This one
inventoryInfoReport.LocalReport.DataSources.Add(objDataSource); <--the error was at this line
|
|
|
|
|
Hello
I have the following scenario.
I have one exe and some DLL.
When both are in the same folder then the exe run fine.
The DLL are used to create a report in a network file.( I have full access to these folders ).
But when I put the DLL in the subfolder(Lib) and change the config file to use then, then I am getting FileIOpermission exception. I thought it is a CAS problem and trying to solve.
Any hint will be a very helpful.
Regards
Anil
|
|
|
|
|
How's the read/write access to that folder?
|
|
|
|
|
Hi professionals
i want a c# code which allow me to record small sound waves whatever extension from a mic.
thanks so much
bahaa
|
|
|
|
|
Try this...
<br />
Process soundRec = new Process();<br />
soundRec.StartInfo.FileName = "sndrec32.exe";<br />
soundRec.Start();<br />
-------------------------------------------
It's code that drives you - Shyam
|
|
|
|