|
I'm guessing that you won't get a number until the record is saved.
I are troll
|
|
|
|
|
Datagridview is not an SQL table. Until the Record is Saved and the Grid is Refreshed you will not get an Identity number. If you made a gridview to generate the number , it does not mean the Database will do the same thing. If your Application is a multi-user application you will have problems e.g lets say a user assumes that the ID is the 10 and the user user does an insert somewhere and faster that the user that assumed it was 10 and the other user will get the identity of 10 and the assumer will get 11.
Hope it helps
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi,
I do agree.. you can add an external col into your grid.
Md. Marufuzzaman
|
|
|
|
|
In some grids I get the right number, in one grid I get a minus number which saves ok afterwards but in the grid I'm working on now I don't get any number at all
|
|
|
|
|
Hi,
I am developing an application in which i use to select data from one grid remove that & display it to the second grid.
I store those data in a local mdb file . when i am selecting rows in bulk(around 50-70 at a time)and then wanted to cut and display in the second grid i am getting this error .
Please help.
|
|
|
|
|
Are you forgetting to close your connections, between operations? Or forgetting to close something that you have opened. A DataReader, or something like that.
Without seeing the code you are using, it is difficult for me to offer more than that. Others might be more helpful.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi,
I am a newbie in programming and all the IT stuff,currently I am developing a webapplication to enhance my knowledge . I am using visual studio 2008,Sql server management studio 2005;in my application I am simply adding names and passwords in a table in Sql.
1)The application works fine when both Sql and published webappliaction on IIS are on same machine!
2)now I want the Sql database to be on other machine, and my published application on other system so that there are two different servers in LAN one the application server and other the database.
please help!
Thanks
shankbond
|
|
|
|
|
shankbond wrote: he application works fine
So you have a working connection string already in your app, it will probably have "localhost" in the string. Change "localhost" to the remote server name.
You will probably need to change from integrated security (using your windows logon) to a SQL userid and password for the app to connect ans include them in the connection string.
A good research site is connectionstrings.com/[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
Mycroft Holmes wrote: You will probably need to change from integrated security (using your windows logon) to a SQL userid and password for the app to connect ans include them in the connection string.
the above solution will help my application to use a sql id and sql passsword fine
but what other changes(or configure) will I have to do in sql server itself?
Thanks
shank
|
|
|
|
|
"Allow SQL Server to accept remote connections"
Quoted, since it is a common search-phrase on Google
I are troll
|
|
|
|
|
You will need to set up the SQL user with adequate permissions on your database. That's it.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: You will need to set up the SQL user with adequate permissions on your database. That's it.
ok I m trying; any good resources you know except msdn?
shankbond
|
|
|
|
|
Hi,
Actually when you remotely perform any SQL request (using OPENROWSET , BLOB type data) SQL server
need the AuC first. That you have the permission to perform this operation.
Md. Marufuzzaman
|
|
|
|
|
Hey,
I have this table:
JAN FEB MAR APR
--- --- --- ---
10 10 10 10
Suppose I'm in March now, how would I total the values of the two previous months (ie. JAN and FEB) to have 20
Please help.
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Well, if that was what I wanted to do, I wouldn't start from there.
Has this design been forced on you, or are you free to choose your own?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
It is forced on me, here's the big picture:
Jan Feb Mar Apr
--- --- --- ---
Budget 10 10 10 10
Actual 10 5 10 0
... 0 0 0 0
... 0 0 0 0
... 0 0 0 0
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Sorry to be so long in replying.
I'm with Luc here, unless somebody else comes up with a viable solution I'd be investigating PIVOT. I have never used it, so I can't be of much help.
Good Luck!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks Henry, Yes, it can be solved using pivot tables or the decode function but my problem is far more complicated to be solved by either of them alone!
Thanks for your time mate!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Is that a SQL table or a flatfile table such as Excel?
"My interest is in the future because I'm going to spend the rest of my life there." - Charles F. Kettering
|
|
|
|
|
Hey Jerry,
It's a SQL Table, but dont worry, I've already found another way round, although it's not professional but it solves my problem. It was for a crystal report file and I figured out I can simply create a typed dataset with the exact names and data types of those of the generated query, generate the datatable fields from the invoking form using ado and set the datasource of the report to the dataset I just created.
Thank you for your time Jerry!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi,
the natural way a datatable grows is by adding rows, not columns. So a more natural design would have only two columns/fields, say "month" and "total", hence it would look like:
MONTH TOTAL
200901 10
200902 10
200903 10
200904 10
and now it becomes very easy to:
- add another month
- select some months and perform calculations on their data
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Hey Luc,
Thanks but I'm kinda forced to this table structure:
Jan Feb Mar Apr
--- --- --- ---
Budget 10 10 10 10
Actual 10 5 10 0
... 0 0 0 0
... 0 0 0 0
... 0 0 0 0
Is there any way to do it with this structure??
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Muammar© wrote: Is there any way to do it with this structure??
Anything is possible, however I have never chosen such hard way of doing things, so I don't know any details.
FWIW: there is a PIVOT command that rotates a table.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Thanks Luc, Yes, it can be solved using pivot tables or the decode function but my problem is far more complicated to be solved by either of them alone!
Thanks for your time mate!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Absolutely. That's why I said, I wouldn't start from there. With people being forced to use designs like that, it's little wonder that some of the questions asked in the forums seem to be a bit daft.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|