dickersonka 104 Veteran Poster
anitha joe commented: Really Helpful +1
dickersonka 104 Veteran Poster
assuming you have a textbox named tbCount
inside the tick event, or a method you call from it
Create a variable named count, on each tick call:
int count = 0;
void timer_Tick(object sender, ElapsedEventArgs e)
{
count++;
this.tbCount.Text = count.ToString();
}
Looks good.
Possibly try removing User Instance=True.
Did you check the permissions on the stored procedure, and can you post the stored procedure sql code when you click on the stored procedure and click script to?
I mean, ensure the user you are connecting has permissions to execute this stored procedure.
Right click the stored procedure and check properties -> permissions, add the user if they are not in the list.
Can you post what you are using for your connection string and the scripted stored procedure that sql generated?
Did you add the user to the stored procedure?
Ensure you have rights, and possible try prefixing with dbo.
And ensure you are specifying the correct database in the sqlconnection
I would suggest doing this, calling p_InsertVehicleWithCustomer from the code.
PROCEDURE dbo.AddNewVehicle
-- Declare variables for inserts into 2 tables
(
@reg nvarchar(50), -- 1
@manufacturer nvarchar(50), -- 2
@model nvarchar (50), -- 3
@genericName nvarchar(50), -- 4
@fleetNo nvarchar(50), -- 5
@serialNo nvarchar(50), -- 6
@engineNo nvarchar(50), -- 7
@chassisNo nvarchar(50), -- 8
@vinNo nvarchar(50), -- 9
@year nvarchar(4), -- 10
@colour nvarchar(50), -- 11
@idvehicle int OUTPUT
)
AS
-- Insert all data into the Vehicle table
INSERT INTO Vehicle(Registration, Manufacturer, Model, GenericName, FleetNo, SerialNo, EngineNo, ChassisNo, VIN_No, YearOfManufacture, Colour)
VALUES (@reg, @manufacturer, @model, @genericName, @fleetNo, @serialNo, @engineNo, @chassisNo, @vinNo, @year, @colour)
-- Retrieve the automatically generated ID value from the Vehicle table
SET @idvehicle = @@IDENTITY
RETURN
PROCEDURE dbo.p_InsertVehicleWithCustomer
(
@reg nvarchar(50), -- 1
@manufacturer nvarchar(50), -- 2
@model nvarchar (50), -- 3
@genericName nvarchar(50), -- 4
@fleetNo nvarchar(50), -- 5
@serialNo nvarchar(50), -- 6
@engineNo nvarchar(50), -- 7
@chassisNo nvarchar(50), -- 8
@vinNo nvarchar(50), -- 9
@year nvarchar(4), -- 10
@colour nvarchar(50),
@idcompany int -- 12
)
DECLARE @idvehicle int
EXEC AddNewVehicle(@reg, @manufacturer, @model, @genericName, @fleetNo, @serialNo, @engineNo, @chassisNo, @vinNo, @year, @colour, @idvehicle OUTPUT)
INSERT INTO Customer_Vehicle(ID_Company, ID_Vehicle)
VALUES(@idcompany, @idvehicle)
The code needs to call the stored procedure we have...I believe lol.
What happens when you do this?
myCommand = new SqlCommand("AddNewVehicle", myConnection);
myCommand.CommandType = CommandType.StoredProcedure;
A tick is based upon the time interval.
For example you set the timer to poll every 1 second.
After 1 second elapsed,
tick
After 2 seconds,
tick
Is this what you are asking?
lol what?
I thought you already have the stored procedure in the database, and you are accepting the values through the code.
myCommand = new SqlCommand("CreateVehicle", myConnection);
myCommand.CommandType = CommandType.StoredProcedure;
You mean the above code is not hitting the database?
I would suggest it is bad practice to use the image_id for sequence. Add an int column to use for sequence, update it if necessary.
You shouldn't need to update it, if you use order by with sequence column, this would be a much cleaner way, than updating an id column.
I'm not understanding that if you already have the company_id, why you don't want to pass it in.
You are inserting the new vehicle, and have a company id already.
I would suggest creating two stored procedures. Maintain this one that inserts a vehicle only and another stored procedure that calls to insert the vehicle, gets the id, and makes the call to insert customer vehicle.
What is the create vehicle stored proc?
You are still adding the companyid parameter.
Take that out and you should be good to go.
myCommand.Parameters.Add(new SqlParameter("@idcompany",i_companyID));//, SqlDbType.Int, 4, "ID_Company"));
select * from employees
group by employee_id
having count(employee_id) >= 2
Easiest to just make it an aspx page and add the javascript to that. If you just need javascript here's a couple links on parsing the query string through javascript.
http://triaslama.wordpress.com/2008/04/12/retrieving-query-string-values-in-aspnet-and-javascript/
http://support.internetconnection.net/CODE_LIBRARY/javascript_Parsing_Query_String.shtml
on the longtext fields use quotes
1, 7, "allow commas, sample"
If you have your images stored locally, then you might want to try to use Server.MapPath to load them.
Sample
//lets assume this path was returned from the database
Server.MapPath("~/images/filename.jpg")
then run the thumbnail code
there are quite a few ways to go about, a good way could to create a page that simplete does image processing like this
Here's a good link to check out.
http://www.codeproject.com/KB/aspnet/generate_thumbnail.aspx?display=Print
This should work. This will get the value of the column for a row. You can do the looping.
obj val = this.dgvFiles.Rows[0].Cells["checkBoxColumn"].Value;
Its built into .net
This is C# but same thing
//put your image path here
string imgPath = "";
System.Drawing.Image img = Image.FromFile(imgPath);
Image thumbnail = img.GetThumbnailImage(64, 64, new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback), IntPtr.Zero);
You must add the callback, but its not used.
this is hibernate, relating database to OR mapping
Hmmm. Something is up with that. Are you running SQL 2000 and SQL 2005 on that machine then?
As long as you are sure the the datasource is correct and you can 'ping' the server then you need to configure the sql server to allow tcp ip connections.
Here's some links to show you how
http://www.datamasker.com/SSE2005_SCM1.htm
For this you can use a query string or session, query string might be easiest.
[B]connect.aspx.cs[/B]
protected void picUpload_Click(object sender, EventArgs e)
{
int year = 1870;
Response.Redirect("upload.aspx?year=" + year.ToString());
}
in the receiving page
private void Page_Load(object sender, System.EventArgs e)
{
int year = Convert.ToInt32(Request.QueryString["year"]);
}
Disadvantage i agree is a lookup, doesn't necessarily have to be dns if you use the ip, but once again that might be bad practice.
Advantages would be scalability and most likely replicating the production environment. Issues can exist that you won't realize until production by using separate machines. Assuming you are in school and creating smaller applications, you might not need to worry about it yet. For larger enterprise applications it is ideal to separate out, for academic purposes its not of the highest priority.
The dataset table, not the sql table
Dim ds As New DataSet("uploads")
....
dgBlowOut.DataMember = "uploads"
try setting the datamember
The dataset can have multiple tables, when you set the datasource you need to specify which table to use
Are you using firefox? It won't display in non-ie browsers.
Where are you calling countfile from?
Also ensure you have proper access on the c:\pictures\ directory, remember IIS is most likely using the asp.net service account to read the directory. You need to set the app pool user with permissions on this folder.
Try uninstalling and reinstalling the video driver.
Try a new monitor and try a new video card if possible and display cable.
It sounds like either, the video card, monitor, or display cable is bad.
select * from table
group by sapno
order by amt desc
google is your friend, try this one
http://www.simple-talk.com/sql/database-administration/ten-common-database-design-mistakes/
It might be, could be in /usr/share or /usr/share/bin, is it giving a classnotfound when you try to use it this way?
Yes its in C#
Take a look at exams 70-528 and 70-536. There are reference materials available from microsoft for these specific tests. Research MCP (Microsoft Certified Professional).
There are different areas of it for sure. There are programming/networking/design/implementation categories amongst others.
Advice would be to research tech jobs/categories. They are all related, but much different. Strengths in logic and math, I would say programming but its not just something to pick up so easily. Take your time and do some research to see what area matches what you are looking for and expertise.
to get the files use
string dir = @"C:\images\";
string[] files;
int numFiles;
files = Directory.GetFiles(dir);
numFiles = files.Length;
string nextFileName = (numFiles + 1).ToString() + ".jpg";
The option you needed is the workstation components, so you can run management studio with running sql server on the same machine.
Might be with the dns exploits recently. Where the site you expect isn't always the one thats resolved.
Add the same code to the form_shown
Add a custom action for uninstall.
You will need a code file for it that inherits from Installer. When you add this to the installer, it will be part of the package, but you can override uninstall to delete the directory.
Typically no. Employees and Country would be good for the table names. There should be no difference whether the you have a 'fixed' set or not.
I see the relationships, but don't see the actual columns.
In the business table, you need the columns GENRE_ID, CATEGORY_ID, and SECTION_ID.
For the businesses without categories, you can just set the column to be null.
When they are being loaded assign the id to either the tag of the row, or in a column.
Assuming you are waiting until a save or submit button is pressed, loop back through all the rows of the gridview. Get the checkbox column for each of the rows and get the id column or tag as well. Then you can pass those values on.
Table layout panel is good, but not for something like this due to the number of rows you might have with dynamic sizing. Use a gridview and add a checkbox column to the row that the user can edit.
Not the easiest task if you are just starting out, but here's the concept.
You can create a table with the same structure and use it for auditing. Use the triggers to catch the insert,update, and deletes and then store the records into the second table as well.
Or you can create a single table for all changes and record them, composing dynamic statements on the fly.
Then you can create an aspx page like normal, and select from the audit table.
If you have very few tables and just starting out, i would suggest the first route. It really depends on how you are wanting to display and if you are wanting to query the data back. If you need any further explanation feel free.
Here's a link of something similar.
http://www.4guysfromrolla.com/webtech/091901-1.shtml
Isn't it UID instead of User?
jdbc driver needs to be
Class.forName("com.mysql.jdbc.Driver");
Are you searching the correct container?
ie if you add it to a panel. Use panelId.FindControl