|
You could first do a Count Query,
SELECT Count(*) FROM table
and then write your code so that you fetch 100 records at a time (or 42 or whatever number) and link that to your progress bar. This would be cumbersome, but progressbars are very important to end-users so it might be considerable.
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
joon_ wrote: This would be cumbersome
And also very very inefficient.
|
|
|
|
|
What would be your suggestion, if the progress bar was a requirement?
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
You know the CommandTimeout - the point at which the query will automatically fail if it takes too long. Progress along time. It might be that you often don't get the progress bar going fully to 100%, but it does tell people that it is progressing and they will know that their wait will be over by the time it does reach 100%.
|
|
|
|
|
For one, it's two trips to the database. Second, this query will return the number of records in the entire table, NOT the number of records that's actually going to get returned. Not to mention this query, if the table has enough records, could actually take longer than the query he really wants to run against this table.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
shriku24 wrote: i have problem to store audio file in database
If you are using SQL Server 2000 use an image column type (you can store upto 2Gb in there). If you are using SQL Server 2005 you can also use varbinary(max) which also has a 2Gb limit and is easier to use.
To get the data in and out use a byte array
byte[] audioData = SomeMethodForGettingTheAudioData();<br />
SqlCommand cmd = new SqlCommand();<br />
cmd.CommandText = "INSERT INTO SomeTable(AudioDataColumn) VALUES (@audioData)";<br />
cmd.Parameters.Add("@audioData", audioData);<br />
cmd.ExecuteNonQuery();
To get it out again just select the relevant column
SqlCommand cmd = new SqlCommand();<br />
cmd.CommandText = "SELECT AudioDataColumn FROM SomeTable WHERE ID = @id";<br />
cmd.Parameters.Add("@id", someIdValue);<br />
byte[] audioData = (byte[])cmd.ExecuteScalar();
|
|
|
|
|
can u give some examples for sql server 2000. I am tried to store audio file using image data type it store data successfully. But in table it looks as some code(number, hex or binary) format not as actual name of that file. and also i can't retrive(play) this file through my vb.net form which is just like media player.please help me.it's very urgent.
shrikant
|
|
|
|
|
Colin Angus Mackay wrote: byte[] audioData = SomeMethodForGettingTheAudioData();
well.. i wanted it for images.. though ia m sure the procedure wud be same..
now the somemethodforinputimages.. how do i go bout it.. i`l have a fileupload control to browse to the file..
how do i link it to the method to input images..
i hope i am clear..
Kunal
|
|
|
|
|
Kunal P wrote: well.. i wanted it for images.. though ia m sure the procedure wud be same..
Yes, you can put up to 2Gb of anything you like in there.
Kunal P wrote: now the somemethodforinputimages.. how do i go bout it..
Get your image file and return it as a byte array: byte[]
Kunal P wrote: i`l have a fileupload control to browse to the file..
I've not used the file upload control. I'd imaging you'd get some sort of stream object or perhaps it has a method that supplies you with a byte array.
|
|
|
|
|
Colin Angus Mackay wrote: I've not used the file upload contro
ok.. lets chuck out the file upload control, i thought that was the only wat to go bout getting the file.
Colin Angus Mackay wrote: Get your image file and return it as a byte array
now.. on the form.. wat kind of control should be created, that returns the file as a byte array..
how did u get the image from the user to be uploaded..
Kunal
|
|
|
|
|
I have already created the tables in access.I want to get the create table queries for the existing tables.
plz help me
|
|
|
|
|
I looked into this, and asked my local ACCESS Guru, and he said that this is not possible.
The only thing that comes remotely close is using Tools > Analyse > Documenter...
From this data you could quickly write create scripts yourself.
Other options are copying your MDB file and just removing all of the data. What exactly do you need it for?
I also found that the CREATE TABLE sql statements are not really supported anymore since Access 1997, so you won't find proper syntax of CREATE TABLE in JET SQL in the Help files of Office, look on Google instead.
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
Does anybody know how to get List of Databases in Oracle?
-- modified at 7:53 Tuesday 20th March, 2007
Nana
|
|
|
|
|
select * from sysdatabases;
but this statement should be master DB
Regards,
Smart Boy
Mumbai,
(INDIA)
|
|
|
|
|
Actually, the poster asked for a solution for Oracle. sysdatabases is for SQL Server (and possibly Sybase?). The concept of server/database is different for Oracle versus SQL Server, meaning I'm not sure of an Oracle solution (assuming you actually did mean database). You might have to look at parsing the tnsnames.ora file or something. I'll post again if I find anything.
Scott
|
|
|
|
|
Hi,
I have a Insert into Table(ColumName1, ColumnName2, ColumnName3, ColumnName4) Values('value1', 'value2', 'value3', 'value4')
If we dont give the Column Names then by default it takes all the columns.
There can be any number of columns so i wanted to know if There is any way in which i can use ColumnNo's instead of ColumnName in the syntax of Insert into Table.
I am using SQL Server 2000.
Plz help me in solving this problem.
Riz
Riz
|
|
|
|
|
How many times are you going to repost the same question all over the place ? This is not a right approach to ask for help.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Why dont YOU answer once?
Nana
|
|
|
|
|
If the question is asked multiple times in different forums, there is no collaboration between people answering the question. Every responder would have to find all the posts for the same question to see how's suggested what, or if there is any new information describing the problem, or even if the question has already been completely answered in another forum!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
There's no real way to do this, because you can't know which columns you are referencing by position. For instance, the following is valid:
insert into table1(col1, col2) values(@col1, @col2) and the same is also valid:
insert into table1(col2, col1) values(@col2, @col1)
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi All. Could someone please explain me why when i add the column, and place the text in cell, the text is not displaying?
DataSet ds = DBEngine.GetOurSIS(Program.DB.Connection);
DataTable tbl = ds.Tables[0];
DataColumn col = tbl.Columns.Add("S_trot", typeof(string));
int ColIndex = col.Ordinal;
for(int i = 0; i < tbl.Rows.Count; i++) {
int CurrShipID = (int)tbl.Rows[i].ItemArray[1];
int CurrSumTrot = Program.DB.GetShipTrotil(Program.OurTeam, CurrShipID);
CurrSumTrot = 10;
tbl.Rows[i].ItemArray[ColIndex] = CurrSumTrot.ToString();
}
dataGridSIS.DataSource = ds;
dataGridSIS.DataMember = TblNames.TblNositeliName;
|
|
|
|
|
hi can some one help me ...
i want a stored procedure or query for selecting jobs when the user enters keywords ..
i couldnt find out how i can do that with "all words" and "any word"....
|
|
|
|
|
You can use OR conditions in the where clause of the query.
You will have to provide options of all words or any word in the UI.
According to the user preference you can change where condition in the stored procedure.
Consider following search query --
"some query with multiple words"
Then your where condition can go like this -
where text_data like '%some query with multiple words%'
OR
where text_data like '%some%' or text_data like '%query%' or text_data
like '%with%' or text_data like '%multiple%' or text_data like '%words%'
You can combine these 2 conditions together if you dont want to provide UI.
Then your where condition will be as this -
where text_data like '%some query with multiple words%' or text_data
like '%some%' or text_data like '%query%' or text_data like '%with%' or
text_data like '%multiple%' or text_data like '%words%'
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Thanks
Hey i have a stored procedure
where i select the jobs based on LOCATION, FUNCTIONAL AREA, EXPERIENCE and KEYWORDS
KEYWORDS : they can add multiple keywords and there is a DROP DOWN LIST( with options exact phase, any words, all words)
How can i write the stored procedure for these three options...
Can you help me PLEASE....
|
|
|
|
|
You can send the search query directly in the KEYWORDS parameter and add another parameter to identify whether the keywords are to be searched for exact words or all words or anything else .... Using this parameter value your where condition changes accordingly.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|