|
This was posted in the VB forum as well since I was not sure which it pertained to.
Ok, not sure exactly how to word this so here goes. I have a winform in my project that has the following:
Controls
1. DropDownList1 - Customer Name
2. TextBox1 - Customer ID
3. DropDownList2 - Site Name
DataBase Tables
1. tblCust - Fields(CustName, CustID, Status)
2. tblCustSiteAssoc - Fields(CustId, CustSiteID)
3. tblCustSite - Fields(CustSiteID, CustSiteName, ...)
What I am trying to do is this:
1. When the form open have customers names bound to the DropDownList1 control with nothing selected
2. Once I select something in the DropDownList1 control (SelectedIndexChanged) have it update the other two controls with the selected customers' data.
I assume I make a DataSet that queries all three tables and I understand how to bind the CustName to the first DropDownList box. What I don't understand is how to use the selected information to get the relevant information for the other two controls.
Thanks in advance,
Taen Karth
Thanks,
Taen Karth
|
|
|
|
|
Can ADO be used in C (not Visual C++), using Microsoft Visual Studio? Is there any sample code on this? Thanks.
|
|
|
|
|
Since ADO is a COM server, I would doubt it.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
Probably not directly, but there is nothing stopping you from creating a Windows DLL that wraps the ADO class heirarchy in a set of public functions. This DLL could then be used in straight C.
|
|
|
|
|
This DLL is not only be used by C, but also other client languages like Delphi, Borland C++, VB.NET etc. I am still figuring out how to wrap this ADO in the DLL so that it can be called by all client languages. Do you have any sample code or references that I may refer? Thanks.
|
|
|
|
|
Does this[^] help?
Farhan Noor Qureshi
if (this == this) thow this;
|
|
|
|
|
DateTime Updating Problem in sql?
below is the query that is a part of a sproc .All table
fields and values are ok. When the mentioned Sproc. is
called in query analyzer it executes well and update all
fields of the table used in UPDATE statement
.
UPDATE Emp_Schedule
SET IOS = 0, HoursWorked = @WorkTime, COA =getdate()
WHERE (Emp_Id = @EmpID) AND (S_Id = @ShiftId) AND (DT =@DayTime)
PROBLEM arises when i call this procedure from C# code all fields are updated Except the COA(DateTime) field.Whats the problem. SProc runs well both in debug mode and normal mode in query analyzer and do updates the values. But when i call in C# only datetime field COA is not Updated? Plz solve this.
THNX IN Advance.
|
|
|
|
|
Is it possible that this is a permissions problem? The user that executes the C# code, do they have execute permissions on the function?
Chris Meech
I am Canadian. [heard in a local bar]
Remember that in Texas, Gun Control is hitting what you aim at. [Richard Stringer]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
I want to brings all the published reports from the server and allow user to view them using SQL Server 2005 Report Builder. Can anyone provide me with a sample code or any website which may be of help.
|
|
|
|
|
Hey everybody,
I know this a pretty silly question but I totally blanked. I'm looking to remove duplicate results from the results set (NOT the table).
Say I have a query like so:
SELECT SomeNumber FROM MyTable ORDER BY SomeNumber ASC
returns the following set:
1
1
1
2
2
3
4
But I want it to return:
1
2
3
4
What extra criteria would I add to the query?
Thanks in advance for your help.
-------------------
abort, retry, fail?
|
|
|
|
|
SELECT distinct(SomeNumber) FROM MyTable ORDER BY SomeNumber ASC
|
|
|
|
|
thank you much, sir. just what i was looking for.
-------------------
abort, retry, fail?
|
|
|
|
|
Did that solution served your purpose ?
|
|
|
|
|
yes it did. thanks again!
-------------------
abort, retry, fail?
|
|
|
|
|
below is the function that compares only time .there are 3 datetime variables.
@StartTime datetime
@EndTime datetime
@DayTime datetime
@StartTime is always less than @EndTime regardless of its
dates.and @DayTime may be any time. We have to calculate
whether @DayTime lies between @StartTime and @EndTime or
not. And on its behalf we return a value.
if @DayTime lies between @StartTime and @EndTime return 1
else return 0.But tested with these values result is not ok.
set @StartTime='12/1/2005 12:30:49 PM'
set @EndTime='12/2/2005 4:30:49 AM'
set @DayTime='2005-12-02 00:56:02.730'
select dbo.udf_IsShiftValid(@StartTime,@EndTime,@DayTime )
it returns 0 where i think it should return 1. plz correct
me where m i wrong.
Actually i have to use this function on CheckInShfit event of the Employee. @StartTime and @EndTime are the time of the shifts that have already been defined in the database very ago. Now whenever Employee ChecksIn we have to confirm wheather he is entering Between his shift timing that have been Defined already in the database, if his CheckInTime (only time not date) @DayTime lies between his @StartTime and @EndTime then he is allowed to enter (i.e 1) else Not(0).
Now keeing in view the baove Scenario, plz guide me
plz modify this function so as it returns 1 if the @DayTime
Lies Between @StartTime And @EndTime else one( BUt keep in
Mind i m required to compare only time not the dates and
@startTime value is always less than @EndTime value)
CREATE FUNCTION dbo.udf_IsShiftValid(@StartTime datetime,
@EndTime datetime,@DayTime datetime)
RETURNS int AS
BEGIN
DECLARE @RtValue AS int
IF
convert(varchar,@DayTime,114)>=
convertvarchar,@StartTime,114) AND
convert(varchar,@DayTime,114)<
(convert(varchar,@EndTime,114)
BEGIN
SET @RtValue=1
END
ELSE
BEGIN
SET @RtValue=0
END
RETURN @RtValue
END
-- modified at 21:40 Thursday 1st December, 2005
|
|
|
|
|
Eg :
CREATE FUNCTION dbo.udf_IsShiftValid(@StartTime datetime, @EndTime datetime,@DayTime datetime) <br />
<br />
RETURNS INT AS <br />
BEGIN <br />
DECLARE @RET AS INT<br />
<br />
IF<br />
(convert(varchar,@EndTime,114) < convert(varchar,@DayTime,114) ) AND (convert(varchar,@DayTime,114) > convert(varchar,@StartTime,114) )<br />
SET @RET=1<br />
<br />
ELSE<br />
<br />
SET @RET=0<br />
<br />
<br />
RETURN @RET<br />
END
Please have a look at this URL also.
http://www.databasejournal.com/features/mssql/article.php/3348181[^]
-- modified at 12:47 Friday 2nd December, 2005
|
|
|
|
|
the following connection string throws an error... how can I have the data source be a network share like so?
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\server\share$;Extended Properties='text;HDR=no;FMT=Delimited(;)';
|
|
|
|
|
Hi, I want to see a complete sample code for a database with C#.NET & SQL server at Windows Base.where i can find it? can anyone send it to me?
-- modified at 17:08 Thursday 1st December, 2005
|
|
|
|
|
check this[^]
"Not everything that counts can be counted..."
-Albert Einstein
|
|
|
|
|
Thanks.you gave me a great help!!!!!!!!!!!
|
|
|
|
|
don't forget to vote if you like it
"Not everything that counts can be counted..."
-Albert Einstein
|
|
|
|
|
I used Crystal Report 10 for created my report and then i added the report to my project.
I opened the report in V.S.2003 and change it, then i saved it in V.S.2003 too.
V.S.2003 told me that it's Crystal Report version is older than my Crystal Report version, but i saved the changed report in it.
Now when i install the project in a client machine , my report don't work.
My language is V.C#.NET & my project is a windows base.
what can i do ,to solve this problem?
|
|
|
|
|
i have created a datagrid on a windows form using vb.net. It is showing the data after retrival from a table. but now i have added a button --update changes and now i want that when the user changes anything in the datagrid it should get updated in the database. how can we do this?
|
|
|
|
|
Once i have created a database in the local sql server, how can i upload it to my website? can I simply copy the two database files to my relevant folder on the web-server (in a manner similar to access database)? Or is there any special method? Is there any detailed article on this?
Secondly, after uploading this database to web-server, how can i update it - locally or online only? can i continue to have a copy in my local sql server, which i can update and again upload the updated version?
thanks in advance
|
|
|
|
|
1. Easy method would be to take a backup, upload it and restore.
OR
2. Use database management tools like Red Gate tools www.red-gate.com[^]
OR
3. Generate DDL, DML scripts, upload and run it on destination server.
Farhan Noor Qureshi
if (this == this) thow this;
|
|
|
|