I'm using VC++ 6.0, and using the ODBC API to connect to the databse. My question is that is there a way to find the limit of the number of fields permitted per Primary Key. Eg. For MS SQL 2000/ 2005 limit is 16 or less fields for a primary key. For MS Access the limit is 10 or less fields for a primary key.
Kuira
Posts
-
ODBC API Query -
SQL Server Management Studio Express and LocksI am not sure, but I am trying to work this out but if I do a CREATE SCRIPT SELECT on a TABLE and execute it using SQL Server Management Studio Express, will it lock access to it for transactional or for update purposes? Like a read commted? or am I going off track here as I am not completely sure about SQL stuff.... :confused:
-
MSDE and MS SQL 2005 Express Edition inquiryI would like to know if I can install both MSDE and MS SQL 2005 Express together such that I have an MSDE Database and also a MS SQL 2005 database to use.
-
List BoxesHad a look on ListBox.MultiColumn property?
-
List BoxWell, more of the case of Web Forms how you need to check if your reloading those Listboxes again, and if so that whenever you reload the page again, it might reload those items again and reset whatever changes you want in the first place. Another issue becomes if its stateless or not (meaning does it retain the data when you press on buttons, that go back to the server to process things and spit back out the result on the WebForm that you asked for). Web Forms are really difficult to determine where your problem is. You need to check how the flow of the web form works, but from hazarding a guess of why nothing is happening is most possibly that you are resetting those listboxes to that nothing is happening. But this is just guessing, it'd be better with a full code rather than a specific method, but thats your call. Kuira
-
List BoxPossible clauses. - How you handle the initliazation. - If its running it on the server this function. - If this method isnt being added on the specific control.
-
Getting data from listviewI dont know if this works but I doubt it cause its wierd the way your putting it to a question: ListViewItem myItems = (ListViewItem) listView1.SelectedItems[0]; textBox1.Text = myItems.Text; textBox2.Text = myItems.SubItems[0].Text; textBox3.Text = myItems.SubItems[1].Text; But thats just my guess :shrug:
-
Data QueryTry this:
static void Main(string[] args) { string dataPath = @"C:\Documents and Settings\Administrator\Desktop\Transimount_Data.MDB"; OleDbConnection conn = new OleDbConnection("Provider=Microsoft.JET.OLEDB.4.0; data source=" + dataPath); OleDbCommand cmd = new OleDbCommand("SELECT COUNT(*) FROM Mounts WHERE Group_Number = 1", conn); conn.Open(); int count = cmd.ExecuteScalar(); conn.Close(); Console.WriteLine(count); }
Kuira
-
Complicated questionI dont think it would work, there could be some Modules that would do this or some COM objects and all, but that could mean data marshalling and other types of issues... IMO if you can make a vb script as an exe that calls those subs for you and use C# to externall call them as a shell that might work out for you. Depends on how "secure" you want this to be.... I'm sure that either way they are not going to be "secure" as you might think..
-
ThreadAbortException and SQL?to do the SqlCommand.Cancel you probably would put that on ThreadAbortException............
-
ThreadAbortException and SQL?I am using a Thread.Abort to abort an SQL command when the user wants to stop the current execution of an SQL Command. However, it seems to take a while for the ThreadAbortException to start up and cancelling the current execution. So I am wondering what takes place when the Thread.Abort that makes the SQL takes about 10-15 seconds to allow it to go towards the ThreadAbortException. -- modified at 22:56 Thursday 23rd February, 2006
-
ExecuteScalar?Yea I thought so but apparently, it didnt, till I restarted VS.NET, then it seems to work as normal, I have no idea why but anyway....
-
ExecuteScalar?I am using Execute Scalar for a COUNT on a query and on the C# side I get a count of 1. Using the same query on the SQL side I get 0 results and (1 row affected). How does ExecuteScalar work, I always thought it grabs only the result of the count...
-
Form LocationI tried getting the location from using Start Position via Centre Screen. But the results give me 0,0 for its location. How do I find its position? -- modified at 20:18 Tuesday 27th December, 2005 UPDATE: Ok, if i use centre screen, I cannot set its location differently unless I use manual, thus is there a way to find the StartPosition location somehow?
-
C# Process UseShellExecute queryI got a simple HelloWorld.Exe that prints out helloworld And I got another application that wants to process that exe file, store as a string and the reprint hello world, called "ReadHelloWorld.exe" But I find that use the property from Process "UseShellExecute" when turned false, is that the Working directory I set to wont be used, so I can only execute HelloWorld.exe within ReadHelloWorld.exe. Is there a way such that I can use the Process to store it as a string without resorting to using a shell to execute the command, store it as a text file, read its contents then removing the temporary text file? Kuira
-
A similar action to a try catch statement?Ok sounds like a good plan to me, I'll use that thanks.
-
A similar action to a try catch statement?Ok, from the exception part, if Test1 fails from there, will that means that Test2 wont fire from the algorithm you written up? If so this should be acceptable, I'll just make a simple exception thats derived or something to say true or false, as long as I dont need to use if statements whenever I need to check each methods return value.
-
A similar action to a try catch statement?.... I dont know how to explain it but I'll try again: - User clicks on a button after they written out a form with a set of data that has been validated on the data side. - The middleware looks at this and then validates the set of data provided by the GUI to determine if the data that has been inputted is valid to be stored in a database. - These set of tests range from testing the database connectivity, if any of the data inputted will conflict with the current set of data or even if the entry cannot be inserted because the exact same data exists. - If one of these tests fail because of those issues, it will stop the test, write a message back to the user to explain the fault, and let the user decide if they want to refix it or cancel the action. So in essence currently in pseudo code its string test(input data, input tablename, output conflictions) { bool = test1() //connect to database if (!bool) { return "cannot connect to database"; } bool = test2(tablename) // checks if the table is not locked at the moment if (!bool) { return "currently in session, please try again later"; } bool = test3(data, tablename) // checks if the data is already inserted if (!bool) {return "data already exists in database!"; } bool = test4(data, tablename, conflictions) //validates if we insert this data and hits a number of constraints if (!bool) {return "Conflictions has occured please look at the conflictions and try again"; } }
-
A similar action to a try catch statement?I have a testing procedure that calls my other testing procedures. If one of them fails the test, I want to be able to catch it, store it as a message and pass it back to the originator. Writing the error and saying this test failed, please try again and telling him to recall this function when he is ready for his set of data to be tested again. That way, the originator will only need to call one function, I will pass him the message pass or fail, and everyone is happy. I dont like the idea of bool = test 1 if bool is true (return message) bool = test 2 if bool is true (return message) ... Imagine I have 100 tests
-
A similar action to a try catch statement?Sounds like a plan, but how do you end the the current method that this boolean is on? eg. Property B {get{read data} set{IF failure [???]}} Method A { [is there something I can do here to conditionalize if B is not true do something] B = test1; B = test2; [this is where it catches the condition when its not true] } -- modified at 19:26 Thursday 10th November, 2005