|
hi i want to create a inventory management system,
my problem is in sql server 2012 , i created a database, i created a table named
products(varchar (50))
in my form c# i have a quantity/name/code/cost price/sell price / and a add button, how do i get those datastructure into sqls
|
|
|
|
|
jamesmc1535 wrote: i created a table named products(varchar (50)) That is not the way to create tables. A table should contain columns which relate to the data items, i.e. quantity/name/code/cost price/sell price etc. There are many samples and tutorials at http://www.codeproject.com/Chapters/4/Database.aspx[^] which will help you.
|
|
|
|
|
I think you're asking for the statements that go in SQL?
If so, there's an easier way to create a database in SQL server.
1. In object explorer,Simply right click on "Databases"
2. Select "New database"
3. Give it a name then click ok
4. Thereafter, expand the databases folder in object explorer to find the db you created.
5. Expand your db and right click on"Tables" to add your tables.
Hope this helps
|
|
|
|
|
Hi,
I've got here a project for a lab-test software for internal use, which has a lot of buttons. It has a main form and some tabs which all have a lot of elements. This results in a lot of event handlers in one file.
Is there any good method to devide this (I thought about a file for every tab )? I tried this with partial class and it did compile (couldn't test if it also really would work) but when trying to jump to one of the handlers in the code editor it always jumps to the original file and sometimes even creates a new empty handler, that's why I dought that it really works.
I don't want to reduce the number of buttons, it is the easiest way of triggering a function also for untrained personnel.
Any hint to this ?
Thanks very much
|
|
|
|
|
The way I would do it is to create a UserControl for each tab page - that way, the number of controls on the main page is reduced to the minimum, and the interactions between the various controls become more rigid and defined - which helps a heck of a lot with maintenance.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I am trying to create a TableAdapter in a DataSet using the "table Adapter Configuration Wizard" in Visual Studio 2010. I am connecting though ODBC connection[DSN connection], the SQL query runs fine but the fill method is showing error "HY010[ODBC][ORACLE] Function Sequence Error".
But When I am doing same thing using Oracle client connection then it works fine but since its deprecated, i want to use ODBC.
Any help is much appreciated.
|
|
|
|
|
Why do you want to use ODBC? It's a generic and unoptimized method for getting at databases. Being generic, you lose the performance benefits of using a direct client and you also lose database engine specific functionality.
Member 11762295 wrote: But When I am doing same thing using Oracle client connection then it works fine but since its deprecated, i want to use ODBC.
What is deprecated? ODP.NET? No, it's not.
|
|
|
|
|
Dave Kreskowiak wrote: What is deprecated?
Microsoft's Oracle client (System.Data.OracleClient ) is deprecated:
The types in System.Data.OracleClient are deprecated and will be removed in a future version of the .NET Framework.
As you say, ODP.NET[^] is still supported. It's even available on NuGet:
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Richard Deeming wrote: Microsoft's Oracle client (System.Data.OracleClient ) is deprecated:
Wow, that's so deprecated I even forgot it existed!
|
|
|
|
|
Member 11762295 wrote: But When I am doing same thing using Oracle client connection then it works fine but since its deprecated, i want to use ODBC.
Microsoft's System.Data.OracleClient is deprecated, but as Dave said, ODP.NET[^] is still supported. It's even available on NuGet:
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi Richard,
Thanks a lot for guiding me.
Is it possible to share an example of creating table adapter using ODP.net
|
|
|
|
|
I've never used Oracle, so I'm afraid I can't give you any examples.
If you're using the wizard, you apparently still need to install the developer tools[^]. With those installed, I'd hope that it would be fairly straightforward to create a table adapter.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Is there any nuGET package for ODBC?
|
|
|
|
|
No, the ODBC classes ship as part of the .NET Framework.
Why would you want one anyway, since your question says your code doesn't work when you use ODBC?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
The issue is several other classesin the application depends upon a web service which uses ODBC connection to connect to DB. so for this table adapter is I create a ODP.Net, either I have to change the webservie code along with all the classes or the option I am considering is re-write the code with DataAdapter instead of tableadapter thereby eliminating this connector issue
|
|
|
|
|
Hi. I created an aplication in C# (Visual Studio 2013) which uses an SQLiteDatabase. To install it on a computer I used Install Shield. But when I run the program and I try to modify some data from database, I receive: "attempt to write in a readonly database", twice. I know I receive that because the user does not have rights to modify that file (database.db) from installation folder but I don't know how to fix this because this app will be installed on other computers and every user should modify the rights for that location folder which is not an option. Any help is welcomed. Thanks!
|
|
|
|
|
Use a better database system?
|
|
|
|
|
Well you think the problem is the database?
|
|
|
|
|
It may be that it isn't suited for your environment, but that's something you'll have to determine.
|
|
|
|
|
What exactly do you mean with "for your environment"? What should I do in that case? I google for an answer, but I didn't find one..I changed the folder destionat and it worked, but I need in "Program Files"..
|
|
|
|
|
DPaul1994 wrote: I need in "Program Files"..
No. That's the wrong place. (If Windows) try the ProgramData or %userdata% directories.
|
|
|
|
|
Please explain "better"
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
"suited for your environment"
(PIEBALD carefully balances on a fence.)
|
|
|
|
|
Looking at the fence, I'd say it is pretty sturdy
The database is not chosen only based on environment; having a server would solve the problem with the file-system rights, but would also be quite a bit overkill if the application is comparable to, say, KeePass.
By the way it reads, it would be data that is accessed by multiple users simultaneous. In that case, SQLite definitely is not suited for the task, as only one person can have a file open for writing at a time.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Simple; put the databasefile in a location where EVERYONE can access it. If the user has no rights, he/she will not be able to modify the file's contents, it's that simple.
As PIEBALD suggested, you could opt for a database-server. Those usually connect over TCP/IP, and have their own authentication - one that is not determined by the file-system.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|