|
Many thankkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Now it is working with your suggestion. Thankkkkkkkkkkkk alottttttttttttttt
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
I don't know if anyone here can help me, I have a working application that uses an ODBC connection to retrieve data from a CSV file.
The only problem I have is that it always treats the first line as Column Names but our company gets sent data from different sources, some include Column Names, others don't.
I would like to make the application more flexible and enable it to work with either format files without having to write a schema.ini file for each import.
The connection string is something like:
<br />
"Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=C:\MyTest;"<br />
Can the connection string be changed to indicate if column info is not included?
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
LearnVisualStudio.Net
|
|
|
|
|
Friends,
I am using MS Access for the first time. Before that,i used SQL-server. The problem is that, in SQL-server, i always ran an insert query successfully. But this query is not running in Access. Letme explain the problem.
In SQL server i have a simple table "Students" with fields 'id', 'StudentName', 'FatherName'. The 'id' field is primary key and is set to "Auto Increment". Now if i need to insert a row in this table i don't need to supply the value of id (if it is set to Auto increment). I always successfully used following query to insert row in this table:
insert into Students values ("Bill", "Gates");
So far so good. Now i have same scenario in MS-Access, same table, same fields and similarly 'id' field is of type "Auto Number". Now, whenever i run the insert query wrote above, MS-Access gives me error that i've not supplied complete arguments. Yes, if i manually give the value of "id" field, the query runs successsfully.
Please tell me how to get rid of manually giving of id value in case of MS-Access.
Imtiaz
|
|
|
|
|
You need to specify the names of fields being inserted:
Insert into Students ([StudentName],[FatherName]) values ("Bill", "Gates");
Why would anyone waste time arguing with an accountant about anything? Their sole function is to record what happenned, and any higher aspirations are mere delusions of grandeur. On the ladder of productive contributions they are the little rubber pads at the bottom that keep the thing from sliding out from under you. - Roger Wright
|
|
|
|
|
how could we use the ado event while using VC6.0?
please give a exsample if possible
|
|
|
|
|
Hello,
I want to use crystalReport10 in my VC++ app.
But after instert it shows me a white paper only,
Can any one help me?
Happy Christmas.
Thanks.
|
|
|
|
|
Hi friends,
I am working on a project where i have to run following code int Sql Server 2000
declare @v int
declare @tab_name char(15)
set @tab_name = 'Employee_master'
declare @str varchar(50)
set @v=exec('select empid from '+@tab_name+' where empid = 6 ')
after getting value of employeeid i have to perform some task. So i want that empid value in variable @v
another solution i found make temparory table and then insert that value in table and then retrive again in variable @v.
But it is very logn step and it make my query heavy coz i have to perform more task after that.
Is there any solution to retrive that exec(------) value in @v variable
Thank You Very much for reading my request
Hemant Mane
|
|
|
|
|
I have my category hiearchy stored within a table called categories. What I need to do is display the actual category hiearchy with a single sql statement.
For example:
I have the following data in the table
category | category_no | category_above
---------------------------------------------------
Computers | 1 | 0
Dell | 24 | 1
Sony | 48 | 1
Pentium 4 | 33 | 24
Pentium 4 | 85 | 48
How would i query a database to sort the records as follows (in the category hierarchy)?
Computers, Dell, Pentium 4, Sony, Pentium 4
so i could then generate text that looks like
Computers
-->Dell
----->Pentium 4
-->Sony
----->Pentium 4
Anyone have any ideas? Right now I have a function that loops through, but the problem is it's using too many resources...I have to open a database connection each time i loop through. So if I had 500 categories i'd be opening 500 database connections, which i don't want.
Any help?
|
|
|
|
|
Try to normalize yout category table. That will be a better solution for this.
Once you normalize, you can show the data in hierarchy. Then use Datarelation to show the data.
Sreejith Nair
[ My Articles ]
|
|
|
|
|
Can you please explain a little further and give me an example...
How would it work say if I had two tables:
If the first table would carry the top level categories (Main) and the second table would then keep the sub level categories...how would that benefit me? I want to make sure that I don't limit the users from creating category levels.
|
|
|
|
|
Try to use DataRelation class for further reference.
Sreejith Nair
[ My Articles ]
|
|
|
|
|
hi,
while connecting in the local machine there no porblem in the connection string. while connecting to the sql server from another machine through network. i got error of "login failed to uesr null". Sql Server is Windows authentication. Connection string is given below. what's the change need in connection string or sql server. bother machines are windows 2000. any one help to me.
strConnectionString = "Integrated Security=SSPI; Persist Security Info=False;Initial Catalog=atc;Data Source=" + m_strServer + ";User ID=sa; Password=;";
Have A Nice Day!
Murali.M
|
|
|
|
|
If you are using Windows authentication then you'll need something like
"Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;"
You don't need the UserID and Password field
For more connection string help, this site[^] is all you need.
Michael
CP Blog [^]
|
|
|
|
|
To add to what Michael said, if you are connecting from another machine you will have to make sure that the user account exists on both machines with the same password. On a small network, like a home network, this isn't too difficult to manage. However on a corporate network this is not manageable and you should look into using Domain accounts for this (the connection string is the same as for local machine accounts, it is just that the account information resides on a domain server somewhere on your network)
Does this help?
Do you want to know more?
WDevs.com - Member's Software Directories, Blogs, FTP, Mail and Forums
|
|
|
|
|
I actually have the same problem but im a compleate beginner so i will ask a stupid question.
How can user account matter if I use windows authetication? Would it be more simple just to skip the authitication and use username and password?
And one more beginners question, what is a Domain account
Hope somebody bothers to anserw
Regards Johan
|
|
|
|
|
Johan finland2 wrote:
How can user account matter if I use windows authetication?
It has to authenticate against an account in windows. Regardless of how you connect there will be an account involved. With SQL authentication you have to specify the account and password in the connection string, with Windows Authentication the operating system will provided the authentication on behalf of the SQL Server.
Johan finland2 wrote:
Would it be more simple just to skip the authitication and use username and password?
I don't understand your question. Authentication is the process of verifying that a user is who they say they are. SQL Server has build in authentication which is useful if people are connecting from non-windows machines. If you are connecting from a windows machine you can let windows provided the authentication details to SQL Server on your behalf by virtue of the fact that you must have passed through some authentication to log on to windows itself.
Johan finland2 wrote:
what is a Domain account
A domain account is an account on a central server. This allows a user to log into any machine within the domain (typically a LAN). This means that the account information is held in a central location and does not have to be repeated on each machine within the network.
Does this help?
Do you want to know more?
WDevs.com - Member's Software Directories, Blogs, FTP, Mail and Forums
|
|
|
|
|
Thx for anserw
I misspelled my second question which actually was: Is it easier to use authentication with password and username, than to use windows internal authentication (where windows suplies the information).
Been doing this for 3 months now, just finished a book on database design with VB.net. Have to admit i dont know anything yet.....
Johan
|
|
|
|
|
Johan Finland2 wrote:
Is it easier to use authentication with password and username, than to use windows internal authentication (where windows suplies the information).
I would say not. Because you then have to store the user name and password in a secure location, or you have to get it from the user somehow. If you use Windows Authenticaion the user will have already given their user name and password when they logged into windows and all the SQL Server needs to know is the Windows accounts that are permitted access. There is a lot less administration involved if Windows does the authentication.
However, windows authenticaion may not be suitable for all situations - for instance, if you have people connecting from non-windows machines or if people are connecting from outside the domain (typically it will be domain accounts within a windows network that are used, but it can also be local machine accounts too).
Do you want to know more?
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums
|
|
|
|
|
Hi all,
E.g "Select * from table_A where firstName Like '%" + string + "%'";
How to change the ad-hoc sql to prepared statement using operator 'like' and '%'?
Thanks
|
|
|
|
|
|
How 'bout putting the wildcard character within the parameter?
string strName = "%john%"
string strSQL = "select * from table_A where firstName like ':PARAM'"
Then assign to your parameter the value of strName.
Chris Meech
I am Canadian. [heard in a local bar]
Gently arching his fishing rod back he moves the tip forward in a gentle arch releasing the line.... kersplunk [Doug Goulden]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
In C# windows application:
There is a datagrid. I add more than 1 record. How can I save all these records in table at one go?
Similary for update/delete
I am currently using the following code to handle one record:
int aa=Int32.Parse(dataGrid1[dataGrid1.CurrentRowIndex,0].ToString());
string ss=dataGrid1[dataGrid1.CurrentRowIndex,1].ToString();
string ins="Insert into test values("+aa+","+"'"+ss+"')";
dt=cc.conn(ins);
dt.AcceptChanges();
|
|
|
|
|
Do you really think this is the appropriate way to learn about a new control? None of your questions is out of line, but asking this many questions about one subject leads me to think you'd be much better if you took the time to do some basic research or sit down with a good book.
A lot has been written about how to use the DataGrid control. All you have to do is look for it.
Charlie
if(!curlies){ return; }
|
|
|
|
|
Charlie Williams: I definitely know about the datagrid control and that I have learnt thru this only. What I have asked is very much relevant.Actually there are many ways to do a thing. I am expecting a better way, that's why I have posted the qs. I want an efficient solution
|
|
|
|
|