|
hi i know that storing a image in a database is not a correct option but requirement is like that so if anyone is having any idea please let me know
i know few thing abt access that the datatype must be ole object and i know how to get back the image so storing is only the problem
i hope i am clear
thank u
sindhu tiwari
its me sid
|
|
|
|
|
sindhutiwari wrote: so storing is only the problem
What about googling[^] it ?
|
|
|
|
|
thank's for the help but i need a code in c# not the complete one even the glimpse of the code will be sufficient i am confused weather to convert the photo in a byte stream or directly saving the object if u have any idea let me know
sindhu tiwari
its me sid
|
|
|
|
|
sindhutiwari wrote: am confused weather to convert the photo in a byte stream or directly saving the object
You need a byte stream. But I think storing images in access database may remove the meta data for the image.
|
|
|
|
|
Please don't cross post.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
HI : The Given Code is to store the specifications of the controls which are added to a form dynamically ,the database used is access ,here global is a class , lsave & i are variables
there is no syntax error at complile time but runtime a error is coming i.e Syntax error in INSERT INTO statement . The database is absolutely fine with correct syntax...
clue's please........................................
OleDbConnection connection = new OleDbConnection();
connection.ConnectionString = WindowsApplication1.Properties.Settings.Default.printsoftwareConnectionString;
connection.Open();
//loop for saving the positions of the labels
OleDbDataAdapter oda = new OleDbDataAdapter("select * from controlspecifications",connection);
OleDbCommandBuilder cmb1 = new OleDbCommandBuilder(oda);
DataSet ds1 = new DataSet("controlspecifications");
oda.Fill(ds1, "controlspecifications");
DataRow dr = ds1.Tables["controlspecifications"].NewRow();
for (lsave = 0; lsave <= i; lsave++)
{
dr[0] = global.projectname + "adsfsd";
dr[1] = lab[lsave].Name;
dr[2] = Convert.ToInt32(lab[lsave].Left);
dr[3] = Convert.ToInt32(lab[lsave].Top);
dr[4] = Convert.ToInt32(lab[lsave].Width);
dr[5] = Convert.ToInt32(lab[lsave].Height);
dr[6] = lab[lsave].Text;
dr[7] = lab[lsave].Font.FontFamily;
dr[8] = Convert.ToInt32(lab[lsave].Font.Size);
dr[9] = lab[lsave].ForeColor.ToString();
dr[10] = lab[lsave].BackColor.ToString();
if (lab[lsave].Font.Bold == true)
{
dr[11] = "bold";
}
else if (lab[lsave].Font.Italic == true)
{
dr[11] = "italic";
}
else if (lab[lsave].Font.Underline == true)
{
dr[11] = "underline";
}
else
{
dr[11] = "strikeout";
}
dr[12] = "dasfsad";
ds1.Tables["controlspecifications"].Rows.Add(dr);
oda.Update(ds1, "controlspecifications");
oda.Fill(ds1, "controlspecifications");
sindhu tiwari
its me sid
|
|
|
|
|
You haven't shown your insert command. What is it?
|
|
|
|
|
i have done this thing before with sql server as a backend database unfortunately it doesnt seems to be working with the ms access if u have any code for inserting data into access database send me i will be thankful to u
even hints will be appreciated
its me sid
|
|
|
|
|
sindhutiwari wrote: i have done this thing before with sql server as a backend database unfortunately it doesnt seems to be working with the ms access
Your code has no insert statement in it. The code you have for SQL Server must have had some sort of insert statement in there somewhere.
Personally, I wouldn't use data adapters - they are more hassle than they are worth I've found. I'd generally write the insert statement and stick it on a regular command object.
|
|
|
|
|
anyway thanks my problem is solved and i have used the insert command now another problem came i need to store a image in the access database i am having an idea that the datatype in the access must be ole object i know how to get the image back from db but inserting is a problem so i u have any idea please do send it to me
thank you
regards
sindhu tiwari
its me sid
|
|
|
|
|
I work in VB.Net, so maybe this is a language difference, but why aren't you filling the datarow by using column names instead of an index? I would guess that the problem is that you are filling a column with an incorrect datatype or something like that. If you used column names instead of indexes, you could insure this would not happen. For example:
dr("SyleColumn") = "bold";
instead of
dr[11] = "bold";
But again, this may not be the exact syntax to do it in C#.
HOpe this helps.
|
|
|
|
|
Hi frndz,
In my machine, I have a MSSQL server named "Local" with one database "TEST1" and in server machine there is also one MSSQL server named "Sever" with one database named "TEST" with table "Tbl"
My doubt is,is it possible to excute
"select * from TEST.Tbl" query
from query analyser of "local"'.
Thanks in advance
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
If you set up a linked server, you should be able to query databases on this server using the syntax server.database.owner.table
Paul Marfleet
|
|
|
|
|
Thank u for your reply.
I setup the linked server command like
<br />
EXEC sp_addlinkedserver <br />
<br />
'server name',<br />
<br />
N'SQL Server'<br />
<br />
select * from [server name].[TEST].[dbo].[Tbl]<br />
but it shows error like
<br />
Server: Msg 18452, Level 14, State 1, Line 7<br />
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.<br />
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
If you are adding the linked server dynamically in code, you should call the sp_addlinkedsrvlogin SP to set up the login credentials required to access the linked server. Specify a SQL Server login if you can't access the linked server using a trusted connection.
If the server you are connecting to isn't an instance of SQL Server, you can use the OPENQUERY function to execute a pass-through query against the server.
Paul Marfleet
|
|
|
|
|
Hi pmarfleet ,
Thanks for your reply.Now I got the solution.
I add this as linked server through Enterprise manager->security->linked server
when i tried this "exec sp_addlinkedserver" SP,it shows some problem.
anyway now its working fine..
Thank you once again for spending time for me!!!
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
through my db i want send e-mails periodically,but i don't know to perform this task periodically . how can i do this ?
|
|
|
|
|
Using db you can not send the mail periodically. But this method will help you.
Create an excutable file which contains sending mail code.
Schedule this excutable file using windows scheduler from control panel.
Now your executable file will check the pending mails from your db and will send the mail. Once mail is sent then set the flag sent so that it will not sent again.
|
|
|
|
|
Have you considered using SQL Server Agent?
|
|
|
|
|
Hi experts,
I've installed Microsoft SQL Server 2005 (Developers edition, not the Express edition) in my machine and what I want to do is create a database there, just including few tables. From where I should start it, I've never use SQL before.
Here are the steps what I've tried after installation.
1.) First open the "Microsoft SQL Server Management Studio".
2.) Then click "File" -> "Connect Object Explorer..."
3.) On the "Connect to Server" dialog box, for "Server type" gives the "Database Engine", and for "Server name" gives the my computer name.
4.) Then click the "Connect" button, but no luck.
I got the following error.
<br />
An error has occurred while establishing a connection to the server. When connecting to SQL server<br />
2005, this failure may be caused by the fact that under the default settings SQL Server dose not<br />
allow remote connections.(provider: Named Pipes Provider, error:40-Could not open a connection<br />
to SQL Server)(Microsoft SQL Server,Error:2)<br />
I appreciate your help all the time...
Eranga
|
|
|
|
|
How should shame myself. Everything is done on WinXP, and SQL 2005 Enterprise Edition on support on it. So I've to use Express Edition. I'm really sorry for waisting your guys time reading my post.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Hi! I know it's possible to have a data-driven subscription in Reporting Services, but I'm looking for a way to have a data-driven schedule. Every month I send out some reports, but can only have these sent out once other data has been updated. Is there any way that I can trigger the subscription schedule based on queried data? Thanks!
|
|
|
|
|
Anyone pls help me!! i am newbie. i got query below, i want the result as NF 20000.00 if it is refinanceAmount. i know below is not a proper query
IF L.LoanID EXISTS IN (SELECT LoanID, RefinanceAmount FROM FastLoan_Applications.dbo.tblLoanPurpose)
SET @LoanAmount = 'N.F.'@RefinanceAmount
Here is the Main SP
set ANSI_NULLS OFF
set QUOTED_IDENTIFIER OFF
GO
ALTER PROC [dbo].[upUpfront_GetPending]
@UserID varchar(10)
AS
BEGIN
--ASSERTION: If a weekly and a monthly upfront run is in pending simultaneously, this SP will only return the weekly upfront.
--To get monthly upfront, weekly must be processed first.
--GET CURRENT UPFRONT COMMISSION RUN (WEEKLY OR MONTHLY, BUT ONLY ONE)
DECLARE @CommissionRunID int
SELECT @CommissionRunID = CommissionRunID
FROM tblCommissionRun
WHERE CommissionRunTypeID IN (1,2)
AND Pending = 1
--UPFRONT LOANS
SELECT U.UpfrontID,
AG.IntroducerID [AggregatorID],
AG.TradingName [Aggregator],
I.IntroducerID,
I.TradingName,
U.LoanID,
'' [LoanIncrease], --tooltip
A.ShortName,
LS12.StageDate [SettlementDate],
L.LoanAmount [Amount],
U.UpfrontRate,
U.UpfrontAmount,
U.ApplicationFee,
U.UpfrontGST,
U.UpfrontTotal
FROM tblUpfront U
INNER JOIN FastLoan_Applications.dbo.vwIntroducer I ON I.IntroducerID = U.IntroducerID
INNER JOIN FastLoan_Applications.dbo.tblLoan L ON L.LoanID = U.LoanID
INNER JOIN FastLoan_Applications.dbo.tblApplication A ON A.ApplicationID = L.ApplicationID
LEFT JOIN FastLoan_Applications.dbo.tblLoanStage LS12 ON LS12.LoanID = L.LoanID
LEFT JOIN FastLoan_Applications.dbo.vwIntroducer AG ON AG.IntroducerID = I.Aggregator
IF L.LoanID EXISTS IN (SELECT LoanID, RefinanceAmount FROM FastLoan_Applications.dbo.tblLoanPurpose)
SET @LoanAmount = 'N.F.'@RefinanceAmount
WHERE U.CommissionRunID = @CommissionRunID
AND LS12.LoanStageTypeID = 6
AND U.LoanIncreaseID IS NULL
UNION ALL
--UPFRONT LOAN INCREASES
SELECT U.UpfrontID,
AG.IntroducerID [AggregatorID],
AG.TradingName [Aggregator],
I.IntroducerID,
I.TradingName,
U.LoanID,
'Loan Increase' [LoanIncrease], --tooltip
A.ShortName,
LIS12.StageDate [SettlementDate],
LI.IncreaseAmount [Amount],
U.UpfrontRate,
U.UpfrontAmount,
U.ApplicationFee,
U.UpfrontGST,
U.UpfrontTotal
FROM tblUpfront U
INNER JOIN FastLoan_Applications.dbo.vwIntroducer I ON I.IntroducerID = U.IntroducerID
INNER JOIN FastLoan_Applications.dbo.tblLoanIncrease LI ON LI.LoanIncreaseID = U.LoanIncreaseID
INNER JOIN FastLoan_Applications.dbo.tblLoan L ON L.LoanID = LI.LoanID
INNER JOIN FastLoan_Applications.dbo.tblLoanPurpose LP ON LP.LoanID = L.LoanID
INNER JOIN FastLoan_Applications.dbo.tblApplication A ON A.ApplicationID = L.ApplicationID
LEFT JOIN FastLoan_Applications.dbo.tblLoanIncreaseStage LIS12 ON LIS12.LoanIncreaseID = LI.LoanIncreaseID
LEFT JOIN FastLoan_Applications.dbo.vwIntroducer AG ON AG.IntroducerID = I.Aggregator
WHERE U.CommissionRunID = @CommissionRunID
AND LIS12.LoanStageTypeID = 6
AND U.LoanIncreaseID IS NOT NULL
ORDER BY I.TradingName
END
Thanks in Advance.
|
|
|
|
|
Your SP does not declare a @RefinanceAmount variable, you cannot use it. Should it be a variable? Or maybe it is a column?
|
|
|
|
|
its not column, its a variable, i need to select it(@refinanceAmount) if, the loanId is present in Refinance(table). i need select the @RefinanceAmount but need to prefix or suffix characters i.e 'NF.Amt' $10000.00
Thanks for your concern
|
|
|
|