Showing posts with label adding. Show all posts
Showing posts with label adding. Show all posts

Wednesday, March 28, 2012

help on starting out with SQL server

hi. i'm starting out with SQL server integration with visual studio.i used the data connection wizard on adding a new connection to my sql server. but i have no idea on how to open/access it like the usual way wherein i use:

SqlConnection myConnection = new SqlConnection(connectionstring);

myConnection.Open();

/*queries*/

how do i go about doing these things with the new connection that i made via the connection wizard? thanks in advance

I recommend that you post this question on the "Getting Started with SQL Server" forum: http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=158&SiteID=1

That is a good place to get help with newbie questions.|||

Are you trying to use this in an SSIS package? If so, could you give some more details on exactly what you are trying to do?

If you are not using SSIS, you're probably in the wrong forum.

|||

Hi nijen,

In SSIS u can choose any connection manager(suitable to your control) or some of the controls can have direct connection interface embedded in itself(without use of connection manager).

Better if u first go through some good books over integration services.

(I assume u are talking about connection through integration services to sql server,since u have posted this question in SSIS forum)

If u r talking about through regular VS .net classes then there are various classes to use. U may have got connection string wrong or there may be some connectivity issues e.t.c.It would be better if you also post error message u r getting.

sql

Friday, March 9, 2012

help needed for 2 tables

hi everyone, i've added 2 tables one is on adding, the other one is on returning. but when i return, the dropdownlist keeps displaying those which are returned already. it shouldnt display because i've already returned.

here are the codes that i add,

"INSERT INTO record VALUES( '" + dateOfIncoming + "', '" + manifestNo + "', '" + hoName + "','" + hoRemarks + "', '" + toName + "', '" + toRemarks + "', '" + purpose + "', '" + timeEntered + "', '" + dateEntered + "', 'Out')"

here are the codes that i return

"INSERT INTO returnRecord VALUES( '" + dateOfIncoming + "', '" + manifestNo + "', '" + hoName + "','" + hoRemarks + "', '" + timeEntered + "', 'In')"

here are the codes that i wanna display in the dropdownlist which i have set the status = IN. means they have returned already so it should display.

this is wad i tried what its wrong -->

"select a.manifestNo from record a, returnRecord r where a.status = 'Out' And r.status = 'In'"

my dropdownlist cant retrieve those records that are already returned. i suspect is the select statement that is wrong. but i cant figure out how. please help me!

regards, ethan

Instead of using inline SQL you really should use stored procedures, if you rewrite these as stored procedures you will be able to test them more effectively in sql management studio. Are you trying to sleect manifestNo from both tables, i think the error lies around returnecord r - you are specifiying the table but the select.