How to read from a csv file and write in sql2000 table by asp.net with VB.net?
440330
Use 'bcp' (bulk copy) command available in SQL Server.
347994
dim cn as adodb.connection\ncn.open "..."\n\ncn.execute "update tablename set update='" & now & "' where id='xxx' "\n\ncn.close
233039
It depends on which language you are writing in.. \n\nIn asp, for example, you would first connect to the database Then you need to split the dob into day month and year\n\n(assuming date format is 01/01/2000\n<%\ndaymonthyear=split(rs("dob"),"/")\n\nday1=daymonthyear(0)\nmonth1=daymonthyear(1)\nyear1=daymonthyear(2)\n\ndate1 = date()\n\ntodaysdate=split(date1,"/")\n\nday2=todaysdate(0)\nmonth2=todaysdate(1)\nyear2=todaysdate(2)\n\ndiffyear = (year1 - year2)\ndiffmonth = (month1 - month2)\ndiffday = (day1 - day2)\n\n%>\n\nThis code is just off the top of my head, you will obviously need to check it.. I also do php and .net if you aren't using asp.\n\nRegards
623061
this will help\n\nhttp://msdn2.microsoft.com/en-us/library/f1f367bx(VS.80).aspx\n\nmy VB is a lil rusty but i looked it up
1182000
http://msdn.microsoft.com/vbasic/learning/default.aspx
282906
Try using an includes file. If you have the VB script, then you can either put it into a file called VB.inc and then reference it like this:\n<!--#include virtual="VB.inc"-->\n\nThis should all you to use the code you currently have in your site. If you want to write to the page, try using\n<script language="visualbasic">\n//your script here.\n</script>\n\nFinally you can save it as a vbscript and reference it as shown above. \n\nGood luck!
1046045
<%\n' Selected constants from adovbs.inc\nConst adOpenStatic = 3\nConst adLockPessimistic = 2\n\nDim cnnExcel\nDim rstExcel\nDim I\nDim iCols\n\n' This is all standard ADO except for the connection string.\n' You can also use a DSN instead, but so it'll run out of the\n' box on your machine I'm using the string instead.\nSet cnnExcel = Server.CreateObject("ADODB.Connection")\ncnnExcel.Open "DBQ=" & Server.MapPath("xl_data.xls") & ";" & _\n"DRIVER={Microsoft Excel Driver (*.xls)};"\n\n' Same as any other data source.\n' FYI: TestData is my named range in the Excel file\nSet rstExcel = Server.CreateObject("ADODB.Recordset")\nrstExcel.Open "SELECT * FROM TestData;", cnnExcel, _\nadOpenStatic, adLockPessimistic\n\n' Get a count of the fields and subtract one since we start\n' counting from 0.\niCols = rstExcel.Fields.Count\n%>\n<table border="1">\n<thead>\n<%\n' Show the names that are contained in the first row\n' of the named range.  Make sure you include them in\n' your range when you create it.\nFor I = 0 To iCols - 1\nResponse.Write "<th>"\nResponse.Write rstExcel.Fields.Item(I).Name\nResponse.Write "</th>" & vbCrLf\nNext 'I\n%>\n</thead>\n<%\nrstExcel.MoveFirst\n\n' Loop through the data rows showing data in an HTML table.\nDo While Not rstExcel.EOF\nResponse.Write "<tr>" & vbCrLf\nFor I = 0 To iCols - 1\nResponse.Write "<td>"\nResponse.Write rstExcel.Fields.Item(I).Value\nResponse.Write "</td>" & vbCrLf\nNext 'I\nResponse.Write "</tr>" & vbCrLf\n\nrstExcel.MoveNext\nLoop\n%>\n</table>\n\n<%\nrstExcel.Close\nSet rstExcel = Nothing\n\ncnnExcel.Close\nSet cnnExcel = Nothing\n%>
919987
first convert them in csv file them export & import later into database
1118794
Do Save As the file as CSV file\nMost of application can import this file type\n\ngood luck\n\nXLMan
646747
You will need to load the XML file into a DOM. The DOMDocument object is part of the MSXML DLL and allows you interact with an XML document.\n\nOnce loaded you can use an XPath expression to determine if what you are looking for exists in your XML document.\n\nHere is the XPath syntax\nhttp://www.w3schools.com/xpath/xpath_syntax.asp\n\nAt the bottom of this page you can see an example of it.\nhttp://www.perfectxml.com/msxmlDOM.asp\n\n - Create the DOM\n - Load the document NB it must be well formed xml otherwise it will error, you may have to trap the error otherwise it continues with unexpected results\n - Try to "selectsinglenode" using your XPath expression (XPath is to XML what T-SQL is to SQL Server databases)\n - If the node exists you will have a node object you can interrogate, otherwise you have 'nothing'
1066458
You can use the GridView control, implement a templatefield column and inside of that have a new SqlDataSource and GridView control.  Note, that SqlDataSource aren't data binding friendly hense the ugly binding w/ old school DataBinder calls. Psuedo code below. (Yahoo answers hates my code blocks, but you should be able to gather a solution from it).\n\n<asp:GridView id="SomeGridView" runat="server" DataSourceId="CustomersDataSource">\n<Columns><asp:TemplateField><ItemTemplate>\n\nCurrent Customer : <%# Eval("CustomerName") %><br>\n\n<asp:GridView id="CustomerProductsGridView" runat="server" DataSourceId="CustomerProductsDataSource"><Columns>(omitted for example)</Columns></asp:GridView">\n\n<asp:SqlDataSource id="CustomerProductsDataSource" SelectCommand='<%# "select * from Products where CustomerId= " + DataBinder.Eval(Container.DataItem, "CustomerId") %>'></asp:SqlDataSource>\n\n</ItemTemplate></asp:TemplateField></Columns>\n</asp:GridView>\n\n<asp:SqlDataSource id="CustomerDataSource" SelectCommand="select * from Customers"></asp:SqlDataSource>
329070
Here is a link to get you started:\nhttp://msdn.microsoft.com/vbasic/default.aspx
64537
Here you go:\nhttp://sqlzoo.net/
1132417
Skip calling the stored proc and use a cursor to grab the rows directly and insert them into the second table.\n\nExample cursor:\n--------------------------\nDECLARE @col1_value VARCHAR(100)\nDECLARE @col2_value VARCHAR(100)\n\nDECLARE cc CURSOR FOR\nSELECT col1, col2\nFROM table1\n\nOPEN cc\n\nFETCH NEXT FROM cc INTO @col1_value, @col2_value\n\nWHILE @@FETCH_STATUS=0\nBEGIN\n\nINSERT INTO table2 (column1, column2)\nVALUES @col1_value, @col2_value\n\nEND\n\nCLOSE cc\nDEALLOCATE cc\n--------------------------
186692
Use Write to save values and Input to read them.\n \n\nPrivate Sub cmdLoad_Click()\nDim fnum As Integer\nDim i As Integer\nDim value As String\n\n    ' Open the file.\n    On Error GoTo LoadError\n    fnum = FreeFile\n    Open "animals.dat" For Input As fnum\n    \n    ' Write the values.\n    For i = txtAnimal.lbound To txtAnimal.ubound\n        Input #fnum, value\n        txtAnimal(i).Text = value\n    Next i\n    \n    ' Close the file.\n    Close fnum\n    Exit Sub\n    \nLoadError:\n    MsgBox "Error" & Str$(Err.Number) & _\n        " loading data." & vbCrLf & _\n        Err.Description\nEnd Sub\n\nPrivate Sub cmdSave_Click()\nDim fnum As Integer\nDim i As Integer\n\n    ' Open the file.\n    On Error GoTo SaveError\n    fnum = FreeFile\n    Open "animals.dat" For Output As fnum\n    \n    ' Write the values.\n    For i = txtAnimal.lbound To txtAnimal.ubound\n        Write #fnum, txtAnimal(i).Text\n    Next i\n    \n    ' Close the file.\n    Close fnum\n    Exit Sub\n    \nSaveError:\n    MsgBox "Error" & Str$(Err.Number) & _\n        " saving data." & vbCrLf & _\n        Err.Description\nEnd Sub\n\nPrivate Sub cmdClear_Click()\nDim i As Integer\n\n    For i = txtAnimal.lbound To txtAnimal.ubound\n        txtAnimal(i).Text = ""\n    Next i\nEnd Sub\n\n \nNote that the Write method puts quotes around the values so the file looks like this:\n\n    "Ape"\n    "Bear"\n    "Cow"
346060
just try going to this link\n\nhttp://www.w3schools.com/sql/sql_intro.asp\n\nmight help
96537
Try this Log Parser from microsoft (Log Parser 2.0)\n\nhttp://www.microsoft.com/downloads/details.aspx?FamilyID=8CDE4028-E247-45BE-BAB9-AC851FC166A4&displaylang=en\n\nYou can even due SQL like queries in your log file using this.